Generic filters

WordPress Migration to Google Cloud (Full Guide)

By Cronos Editorial Staff on April 23, 2022

WordPress Migration to Google Cloud (Full Guide)

So you want to host WordPress on Google Cloud?

This guide will take you step-by-step through the process of deploying a WordPress website to Google Cloud.

Let’s get started!

three steps gcp


In this introductory section of the guide, you will learn about the pros and cons of moving to Google Cloud. You will also learn about the costs of hosting WordPress on Google Cloud, including the importance of deploying a solution that balances efficiency with performance.

After you’ve read through this introdution, the guide will then walk you through the process of deploying a WordPress website to Google Cloud.

Why host WordPress on Google Cloud?

Google Cloud is an excellent platform for hosting WordPress websites that require scalability, resiliency, and performance.

gcp network 01

Hosting WordPress on Google Cloud means your website is powered by the same global network that powers Google.

The #1 reason why you should host WordPress on Google Cloud is because you’re developing a website that you predict will grow in size and complexity over time, and you require a highly-scalable infrasture that can grow with your website.

Below is a list of pros and cons to consider when determining whether to host your WordPress website on Google Cloud:

  Pros of Google Cloud hosting

  1. Significantly Increased performance
  2. Virtually unlimited scalability
  3. Highly cost-effective for large projects
  4. Greater control and flexibility
  5. Native integration with Google products

  Cons of Google Cloud hosting

  1. Steep learning curve for beginners
  2. Requires significant time investment
  3. No customer support options included
  4. Greater risk exposure for new users

Cost of Hosting WordPress on Google Cloud

The cost of hosting WordPress websites on Google Cloud (compute engine) varies widely, and depends on many factors. Generally, the cost ranges between $1-$30 per month for typical WordPress websites.

Balancing efficiency and performance

When selecting the infrastructure to use for hosting your WordPress website on Google Cloud, it’s important to understand the need for balancing efficiency and performance.

Below is a side-by-side comparison of an efficiency ($0.08/month) vs. performance ($29.71/month) based configuration for hosting WordPress on Google Cloud.

efficiency vs performance 
A side-by-side cost comparison of an efficiency vs. performance configuration for hosting WordPress on Google Cloud. Use the Google Cloud Pricing Calculator to determine the costs of various configurations.

Efficiency Configuration

The efficiency configuration is optimal for low-traffic websites (under 1000 daily users). This configuration takes full advantage of Google Cloud’s generous Always-Free Tier, which provides an f1-micro instance, as well as 30GB of HDD persistent disk storage, all at no cost.

This strictly efficiency-based model will allow you to host your WordPress website on Google Cloud at a very low cost, however, larger websites strictly adhering to the efficiency model may incur performance issues.

Performance Configuration

The performance configuration is optimal for websites with higher traffic volumes (over 1000 daily users). However, unlike the efficiency configuration, neither the n1-standard instance nor the 30GB SSD persistent disk are covered under Google’s Always-Free tier.

This strictly performance-based model will allow for your website to out-perform the efficiency model, especially under heavy load. However, low-traffic websites that utlize this configuration may be allocating resources inefficiently.

Which configuration should you choose?

One of the benefits of migrating to Google Cloud is that you can take advantage of their ‘pay-as-you-go’ model, which means only paying for the resources that your website requires, and nothing more. That being said, a good rule of thumb is to start small, and upgrade only when necessary. To determine whether upgrading is necessary, you will need to monitor your instance’s performance metrics.

To access your instance’s performance metrics, start from the Google Cloud sidebar menu and navigate to Compute Engine > VM Instances, then click on your instance. From here, you’ll see a Monitoring tab at the top of the page, which links to a dashboard displaying your instance’s performance metrics.

cpu usage graph 
Compute Engine contains a Monitoring dashboard complete with graphs of your instance’s performance metrics.

The most important metric to assess the performance of your instance is CPU usage. CPU usage consistently under 60% is ideal. If CPU usage is consistently over 60%, you may want to consider upgrading your machine size.

In addition to CPU usage, you’ll also want to monitor the free space available on your persistent disk. To check available disk space, use the df command.


Part I – Configure WordPress

In this section of the guide, you will deploy a WordPress website on Google Cloud using the efficiency configuration, which consists of an f1-micro instance and a 32GB HDD persistent disk, at an estimated cost of around $1 per month.


1. Deploy WordPress

google cloud marketplace 01 
From the Google Cloud sidebar menu, navigate to Marketplace.
bitnami certified wordpress 02 1024x438 1 
From the Marketplace dashboard, type WordPress into the search field, then select WordPress Certified by Bitnami and Automattic.
launch button 021 1024x711 1 
Click on the LAUNCH button to begin configuring your WordPress instance.

2. Customize Deployment

gcp deployment configuration 03 483x1024 1 
Modify your instance configuration according to the settings above, making sure to change the Zone to represent where most of your website’s visitors are located. You can also upgrade the Machine type and/or Boot disk size in GB accordingly. Finally, click on the Deploy button to deploy your WordPress instance.

Part II – Configure Domain

Now that your WordPress instance has been deployed, you will configure a domain name for your new WordPress website. Although the tutorial uses Namecheap as the domain name provider, the configuration is universal and will work with any domain name provider.

3. Copy Instance IP Address

copy ip 04 1024x569 1
Navigate to your VM Instances dashboard and copy the IP address that has been assigned to your WordPress instance.

4. Enable DNS Settings

namecheap basic dns 05 1024x943 1
From your web browser, navigate to your domain name provider (we recommend Namecheap). Navigate to the settings page for your domain, and select Namecheap BasicDNS from the NAMESERVERS row.

5. Create DNS Record

add dns records 06 1024x587 1
Next, click on the Advanced DNS tab at the top-right of your domain name dashboard. Then, in the HOST RECORDS row, create a new A record as shown in the image, however, remember to replace the IP address in the image with the IP address of your instance (which you copied in a previous step). Next, create a CNAME record as shown, but remember to replace with your own domain name.

Part III – Configure SSL

Now that your website’s domain name has been configured, you will learn how to enable SSL for your domain name. To do this, you will connect to your WordPress instance via the SSH terminal, then execute a script which will automate the process of configuring SSL for your website.

6. Connect to WordPress Instance

ssh into instance 07 1024x514 1
Return to your VM Instances dashboard, and click on the SSH button in order to connect to your WordPress instance.

7. Execute SSL Script

execute ssl script 08 1024x819 1
Now that you’ve clicked the SSH button, a new terminal window will open displaying the connection to your WordPress Instance. Copy the command in the box below, and paste it into the terminal window, then press Enter.
					sudo /opt/bitnami/bncert-tool


After you’ve pressed Enter the script will prompt you with a series of questions, which you will answer by entering either y (for yes), or n (for no). We recommend answering each question in the following way, remembering to replace each bolded instance of Cronos with your own domain name or email:

					Domain list []: Enable HTTP to HTTPS redirection [Y/n]: y Enable non-www to www redirection [Y/n]: n Enable www to non-www redirection [y/N]: y Do you agree to these changes? [Y/n]: y E-mail address []: Do you agree to the Let's Encrypt Subscriber Agreement? [Y/n]: y


Next Steps…

Well done! You’ve successfully deployed a fully-functional WordPress website on GCP, however, there are still some very important concepts that need to be covered. In this Next Steps… section of the guide you will learn how to retrieve your login credentials and login to your WordPress website, and optionally import an existing WordPress website.


8. log in to WordPress

google cloud marketplace 01 1
From the Google Cloud sidebar menu, navigate to Marketplace.
view your solutions 09 1024x1005 1
From the Marketplace dashboard, click on Your solutions.
view your solutions 091 1024x623 1
Select your recent deployment from the list.
view your solutions 092 1024x696 1
Next, copy both the Admin user and Admin password (Temporary) from the list. You will use these credentials to login to your WordPress website in the next step.
view your solutions 093 1024x693 1 e1650720033743
Visit your WordPress login page, and use the username and password that you copied from the last step to log in to your website.






2022 Cronos Inc. © ®


WordPress Migration to Google Cloud (Full Guide)

WordPress Migration to Google Cloud (Full Guide)

Cronos - April 23, 2022