GCP — Install WordPress on Google Cloud Platform with Custom Domain
Hello everyone!
I wanna share my task in my office regarding creating a WordPress website as a demo web for our WordPress plugin called “WooFlick”.
I will share about what’s WooFlick :D
What are goals?
- Host WordPress in Google
- Access WordPress web with a custom domain
- use Https
My Tools:
- Google Compute Engine
- WordPress
- Google Domains
- CertBot
Step 1 — Go to Google Cloud Marketplace
We will install WordPress by Marketplace. I use this WordPress just to install our WordPress plugin. So, I choose the easiest way!
Step 2 — Install Marketplace
Launch! 🚀
Setup Page
It will open a new page to you set up a WordPress. In this article, I will use the cheapest spec.
- Deployment name: Virtual machine name
- Zone: us-central1-a (the cheapest price)
- Series: E2 (e2-micro 2 vCPU, 1GB memory)
Let’s click deploy! Now, you are deployed WordPress to your cloud 🥳
Step 3 — See your deployment result
Click the details, you will see information regarding your WordPress.
See “Site Address” (External IP) and SSH button. We will use it
Step 4— Connect to a custom domain (Google Domains)
Just create an A record with that IP. I put that (External IP) to subdomain.
At this step, you can access your virtual machine with a custom domain 🥳
Step 5— Add HTTPS by creating a certificate via SSH
Click the “SSH” Button, It will open a new tab
Step 5.1 — See your operating system
Run this command to see your OS lsb_release -a
. My SSH show “Debian 10 (buster)”
Step 5.2 — Open CertBot
Follow the instructions from certBot
The first installation is “Install snapd”
$ sudo apt update
$ sudo apt install snapd
$ sudo snap install core
Continue the installation process from CertBot until point 7
Step 5.3 — “sudo certbot — apache”
in point 7, You will run this command to install the certificate
Now, you can access your domain with https:// 🥳
Step 6 — Update Site URL in WordPress Admin Page
Login to your IP/wp-login.
Done.
Thank you for reading my article!
Reach me on Linkedln. 🚀