To host a WordPress, there are several ways from using shared hosting to use our own dedicated server both physical or virtual. The virtual itself now becomes trend because to build the infrastructure now, it becomes easier.
Google Cloud vs Shared Hosting
When people using shared hosting, it is because the panel to control website has been familiar over years. Not like cloud servers where we need to configure everything from initial server configuration to networking. Installing WordPress it self on cloud server becomes very difficult because we need to configure web and database server also.
Cloud hosting providers understand this. They try to make an interface as easy as Cpanel. Here we will talk about how to use it on Google Cloud. Before talking it we must know that moving to cloud server comes with many benefits like big resource so our website is faster than ever. There are three scalability on Google Cloud:
- Installing WordPress on Compute Engine. This is the basic scalability on Google Cloud Platform. It will use virtual Instance on single virtual machine as if we have our own single server. The capacity is big enough compared to most shared hosting service. It is suitable for medium size blog with regional readers. The scalability is manual process, that is, when the capacity of the server for example RAM exceeds, we need to scale it manually. This is good for starters, especially when we know how many regions we will serve.
- Installing WordPress on App Engine. When our website from the beginning is targeted to reach readers from regions like for holiday website that has variable traffic and sometimes peak on several seasons, then this is a good one.
- Third, WordPress on Kubernate Engine. If we want to target readers from many countries with automatic scalability, then this is the choice.
Deploy Compute Engine on G Cloud
What we talk here is building WordPress on Single Compute Engine machine on Google Cloud Platform. Here are the steps:
It is assumed that you have completed registration on Google Cloud Platform and enabling billing profile. On the left side you could choose Marketplace and choose WordPress software from Blog and CMS. Choose WordPress.
Virtual Machine Configuration
Then, configure your machine according to your preference. It is all about Operating System, Processor and RAM capacity and also disk storage. In the Zone, chooce nearest location to your readers.
After completing these steps, we have the following:
- A machine with WordPress installed with all web server and database server, running and ready to be connected.
- IP address of the server
Connecting Domain and Google Cloud VM
To access the machine from outside, we need domain name. When registering a domain name, it comes with DNS where we could put IP address of our machine there. There is option also in Google Cloud Platform to create DNS and then fill the IP address. When we use DNS from Google Cloud Platform, we need to change nameserver on our domain registrar dashboard to DNS server we set on Google. Here are the step to set DNS on Google:
- From the left side of Google Cloud Platform dashboard, choose Network Services and choose Cloud DNS
- Fill all of the requested field and then press Create
- When the zone is ready, press Add record set
- In the zone, what we need to add is A record for @ and another A record for www
- Finish. You can now access your WordPress website after redirecting nameserver to GCP from your domain registrar
After reading this article, we know that todays, to create world class WordPress website that is fast and secure, is very easy by following the steps above.
There are many things we need to know like DNSSEC. It is a security feature to synchronize domain with DNS. Not all domain registrar has this feature. However, by following these settings, you WordPress is ready to be used and has more than sufficient security.