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, 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 are completing the 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.
Create a New Project
For installing a new compute engine, you need to create a fresh new project if you haven’t started it yet. If you have projects, then select one of them, then go for the next step.
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 click on the “LAUNCH” button. Then fill out some details, e.g., Deployment name, Machine type, Storage and Type, and Firewall.
When you 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.
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.
You have to change the IP address from ephemeral to static. Because if you restart the system or accidentally reboot the compute engine, your IP address (new IP) will be adjusted automatically cause of restarting the system. You also need to change the DNS IP address for the domain routing.
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” to create a name server and point out the IP address.
Now click on “CREATE ZONE” for further process.
When we click on “CREATE ZONE,” 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 copy nameservers and paste them 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 on your keyboard to save changes.
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.