Google Cloud one of the most popular cloud services after AWS and Microsoft Azure. If you want to create a website and find the best hosting service then Google Cloud or GCP is for you. Also, Google provides a free subscription for one year.
We have already explained step-by-step how to sign up for Google Cloud just checkout. When you will be completing GCP sign up process then you need to go through these steps for web hosting:-
- Create A Project
- Launch A Compute Engine
- Change IP Address to Static Mode
- Create Cloud DNS
- Change Name servers on Domain Registrar’s Dashboard
If you follow these simple steps, then you can easily host a WordPress website for a year for free.
Table Of Contents
1. Create a New Project
For installing a new compute engine you need to create a fresh new project if you haven’t created yet. If you have projects then select one of them, then go for the next step.
2. Launch a Compute Engine or VM
For this process, we need to click on “Market Place” and search for “Bitnami WordPress”
After getting a search result you need to select “WordPress Certified by Bitnami and Automattic”.
Now simply click on the “LAUNCH” button. Then fill out some details e.g. Deployment name, Machine type, Storage and Type, and Firewall.
When you will click on “Deploy” then GCP will show you the process of deployments. There you can find your WordPress Admin Password and Username.
When you get this then your compute engine installation is done.
3. Change IP Address in Static Mode.
By default GCP always sets the IP address in the “Ephemeral” type. It could cause an error when you shut down or restart your compute engine. In ephemeral mode when computing engine restart then the IP address would be changed and it happens whenever you restart your VM.
Click “VPC network” and select “External IP address”
Now click on “Ephemeral” and select the “Static” type.
Now the next step.
4. Create Cloud DNS
Select “Network services” and then “Cloud DNS” so we can create a name server and point out the IP address.
Now click on “CREATE ZONE” for further process.
When we click on “CREATE ZONE” then GCP automatically generates Name servers (NS) details. We need to add two more records set “Recordset A” and “Recordset CNAME” as you can see above in the image.
5. Change NS details on Registrar DNS Management.
Now add all NS details on your Domain DNS management. You need to just copy nameservers and paste it on your domain DNS management.
In the next step.
6. Edit WordPress URL using SSH on GCP
Open Google Cloud Console and connect your VM with SSH and run the following command :
sudo -i nano /opt/bitnami/apps/wordpress/htdocs/wp-config.php
define('WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST'] . '/'); define('WP_HOME', 'https://' . $_SERVER['HTTP_HOST'] . '/');
After editing the URL with your domain name hit CTRL+X and Enter. All edited content will be saved.
Check, everything is working or not
After a while, we open the site in a new tab for checking it’s working or not, and our all steps are great, all working. See the picture below.
There also left some work you can see. We have to set up an SSL Certificate and Removing the Bitnami logo. So you can read our next blog for these works.
- How to add expires headers on WordPress?
- How to Setup a Custom Email Address with Zoho?
- How to Increase WordPress maximum file upload size?