How to create a WordPress Website on Google Cloud Compute Engine
In this article, we will learn, how to create a WordPress Website on Google Cloud Compute Engine?
We will cover the following key points in this video
1. Create a new VM Instance
2. Map a Domain
3. Install SSL Certificates
To create a new VM instance open the Google Cloud page. Visit http://cloud.google.com.

Then click on Go to Console. We are assuming you have a valid Google Cloud Compute Engine billing account and you logged in. At the Google Cloud Compute Engine console or dashboard, select Marketplace from the left menu. Then we need to filter the VM options. We are looking for “Blogs & CMS” then “Free”. Now we have multiple options for WordPress VM at the time of writing this article we have the following options for WordPress.
- WordPress
- WordPress 4 on PHP 5
- WordPress 4 on PHP 7
- WordPress Certified by Bitnami
- WordPress Multi-Tier
- WordPress MultiSite
- WordPress MultiSite Certified by Bitnami

For this article, we will select WordPress Certified by Bitnami. Once we selected the WordPress Certified by Bitnami option, we are on the overview page for the same VM. Click on the “Launch on Compute Engine” button to create our VM for WordPress.

Then we need to select the VM options such as name, location, Hard Disk Type and Size, Http and Https firewall rules. I am fine with the default options. Ensure you have enabled, the HTTP and HTTPS traffic. Once you are done with VM options click on the Deploy button to launch the VM machine.

Once our VM machine is started successfully. Visit the server IP to check the server status. By visiting the server IP, you can find the default WordPress Homepage. We are done with the VM installation. Next, we need to map our custom domain with our VM instance. For this, we will create a DNS zone for our Domain. To create a new DNS zone for your domain, click on Cloud DNS. It is available under Network Services in the left menu. Next, on the cloud DNS create a new Zone for your domain. Once you have created a DNS zone, then you will receive 4 name servers. You need to add all the nameservers on your domain provider control panel. Once you have updated the nameservers, then you need to create the DNS “A” record and a CNAME record for your domain. The “A” record is to point our domain with the VM we created. And the CNAME record is to handle the WWW alias for the domain. The following image is for the DNS zone for our domain "teaexpress.co.in”.

We are done with the DNS zone next. Try to visit your server using the Domain. If your domain is not reachable, please wait for some time. Name Server and DNS Zone related changes will take some time to take an effect.
We are done with the VM creation and Domain mapping. Next, we need to install the SSL certificate for our domain. To install the SSL certificate, we will use the Let’s Encrypt certificate bot. To use the Let’s Encrypt, certificate bot we need to install it first. To install the certificate bot first create a directory for Let’s Encrypt. We will install the certbot in our new directory.
Execute the following command to open the Bitnami folder.
cd /opt/bitnami/Next, Create a Directory for Let’s Encrypt in the bitnami folder and Open it.
sudo mkdir letsencrypt
cd letsencryptNext, Download the Certificate bot installer using the following command.
sudo wget https://dl.eff.org/certbot-autoNext, to use the certbot-auto installer we need to change its permission. To change the permission for the certbot-auto installer execute the following command.
sudo chmod a+x ./certbot-autoNow we are ready to use the certbot installer. Use the following command to install the certificate bot.
sudo ./certbot-auto
Next, to install the SSL certificate we need to stop the bitnami services. The following command is for stopping the bitnami services.
sudo /opt/bitnami/ctlscript.sh stopTo create an SSL Certificate, we need to execute the following command. We are installing the SSL certificate for our domain teaexpress.co.in. We are using the same domain in all our commands during the SSL certificate installation. You need to change it as per your domain name. The following command is for issuing a new SSL certificate for teaexpress.co.in. The command will prompt for some questions. You need to provide values based on your domain.
sudo ./certbot-auto certonly --standalone -d teaexpress.co.inAfter completing all the prompts our certificate files will be available in the following locations
/etc/letsencrypt/live/teaexpress.co.in/fullchain.pem
/etc/letsencrypt/live/teaexpress.co.in/privkey.pemWe need to move our above files in the bitnami apache directory. Open the bitnami apache conf directory and delete the following files. Delete the following files from /opt/bitnami/apache2/conf/
sudo mv /opt/bitnami/apache2/conf/server.crt /opt/bitnami/apache2/conf/server.crt.old
sudo mv /opt/bitnami/apache2/conf/server.key /opt/bitnami/apache2/conf/server.key.old
sudo mv /opt/bitnami/apache2/conf/server.csr /opt/bitnami/apache2/conf/server.csr.oldNote: It is always a good practice to delete the old files when the new configuration will work correctly. This practice will help you to revert all your changes. We are renaming the existing files instead of deleting. In case of any issue, we only need to rename the original files. Next, to install the SSL certificate we need to create a link for fullchain.pem with server.crt. And privatekey.pem with server.key. The following command is for the same purpose.
sudo ln -s /etc/letsencrypt/live/teaexpress.co.in/fullchain.pem /opt/bitnami/apache2/conf/server.crt
sudo ln -s /etc/letsencrypt/live/teaexpress.co.in/privatekey.pem /opt/bitnami/apache2/conf/server.key
After, executing the above command we need to restart the bitnami services to apply all the new changes. Execute the following command to restart the bitnami services.
sudo /opt/bitnami/ctlscript.sh startWe are done with all the changes. Visit your domain over SSL to confirm everything is working fine. You can check this video for all the above changes.

