While considering what to write for my first How-To article, I came to a realization that the entire process for deploying WordPress and getting it to run on a cloud provider with a custom domain is a rather arduous process. While there are many guides scattered around the internet detailing the various stages of setting up, the concept of a holistic, DIY-everything guide is missing – especially if you go into the details of EXACTLY what platforms and services you are using. Therefore, I’d like to write a comprehensive guide for how to deploy a WordPress instance by yourself using Google Cloud, followed by how to register this WordPress to a custom domain hosted by Google Domain. Finally, I will walk you through the steps of SSL verification and having all traffic route via HTTPS for enhanced security.
To prevent bulking of a single article, I will separate this holistic guide into three separate parts. Feel free to jump to the next article when you are done with this one. For your convenience, the guides are outlined below:
Table of Contents
Why Google Cloud?
To be honest, for individuals who are starting out and want to quickly jump in and get started with WordPress on a single, self-hosted instance, many of the cloud services available today have free tiers to get started on. For example, you can run WordPress using AWS for little to no cost provided there is low to medium traffic on a monthly basis. Similarly, Azure also has free tier services, with stricter limits. Lastly, Google Cloud Platform (GCP) also comes with its own free tier. You can read about some of the differences here, but do keep in mind that there are minor differences between cost for each service, so always DYOR (Do Your Own Research).
Since this guide series will focus on GCP, let’s go into more detail about the free services. First of all, to avoid confusion, allow me to go into detail about the GCP Free Trial versus the Free Tier mentioned above. Anyone with a Google account may apply for a 12-month, $300 credit free trial ($300 value will be properly converted to the currency of your residing country). Within this 12-month period or within the $300 budget (whichever comes first), any services usage that’s not supported in the free tier will be deducted from the $300 balance. In other words, if you remain completely within the free tier service, there will be no deduction from the $300 you get from your 12-month free trial. Of course, this makes it safe for you to play around with GCP and explore other features and perhaps use the credits as an insurance in case your site’s traffic expands quickly.
Pre-Requisites
For this guide, only a GCP account set up (billing included, and Free Trial if you wish to partake) is necessary:
Set Up New Project
To get to Figure 1-1 above, new users will need to first create a project. I believe you will be prompted to do so immediately if you just accepted to using the GCP service.
Fill in the Project Name to whatever you like. For organization, you may leave it at “No organization”. Once done, click create, and wait upwards of a minute or two for GCP to instantiate your project.
Execute and Confirm Click-to-Deploy
Now that you have a new project, it is time to use the convenient click-to-deploy feature to have GCP spin up a VM and configure WordPress for us.
From Figure 1-1, on the bottom left section labelled “Getting Started”, click on “Deploy a prebuilt solution” which will bring you to a whole range of items to choose from. In the search bar, type on “wordpress click to deploy” and wait a moment for the results to refresh. Choose the option labelled “WordPress” with the description “Google Click to Deploy”, as shown below:
Click on the Launch on Compute Engine button in the resulting page. Do not worry about the estimated costs shown – we can change the instance to one that is supported by the free tier immediately afterwards.
You should see a “Configuring APIs, This may take a few minutes” message. Go grab a cup of coffee or something and come back later. You should arrive at the following screen automatically:
- For Deployment Name, enter an instance name of your choice.
- Set Zone to the region of the world you want this instance to be hosted. For example, I’m in Tokyo so I choose asia-northeast1-a.
- Machine Type is “1 vCPU” by default, which is not part of the free tier plan. The only selection for free tier is the “micro (1 shared vCPU)” option.
- Leave everything else as-is and click “Deploy“.
[Important!] Memo the Username/Passwords
You should be at the following screen. You may continue once you see something like “##instance_name## has been deployed” notice on the upper left corner, and that the right-hand-side column has values for site address, WordPress administrator username, and so on:
Note the WordPress administrator username and password, as that is the information you need to login to the administrators panel.
The MySQL password is for the “root” user and is required for accessing the MySQL database which lives inside of your instance. Under normal circumstances you won’t ever have to directly manipulate the WordPress database, but it might save you from being locked out of your WordPress because of some misconfiguration (it happened to me)! That said, it is better to note it, just in case.
Don’t worry if you moved away from the page and forgot to jot down the credentials – the information will be kept inside the VM instance details for you to come back and refer to.
Confirm Site is Operational
At this point, you can click on the Site Address which should take you to the default WordPress site. Hooray!
Let’s see if you can use the Admin login credentials in Figure 4-1 to login to the administrators panel. Append “/wp-admin” to the URL and hit enter to reach the admin login page. Fill in the credentials and try logging in. It should take you to the admin console:
Proceed with steps to reset your password once you’re successfully in.
Next Steps
Congratulations! You have finished setting up your WordPress site using Google Cloud Platform!
As you may notice, your URL is currently your IP address, and using unsecured HTTP protocol, both of which hurts your site’s credibility and SEO rankings.
If you have a custom domain, you should proceed with registering it to this site so that other people can begin to access using a more memorable URL. Remember that part 2 of this guide series will go into detail about how to register a domain you purchased on Google Domains to the WordPress instance you created above.
Lastly, if you would like to perform SSL verification to convert your site from HTTP to HTTPS, you can follow my part 3 guide. You will have to get down and dirty with accessing your instance via SSH and performing from Linux commands, but that should be no problem for you who originally planned to self-host your site to begin with, right? 😉