One of the essential steps you need to do after deploying WordPress on Google Cloud Platform (GCP) is setting up a domain name.
In my past tutorial, you learned How to Install and Setup WordPress on Google Cloud. After successful installation of WordPress, you can see your site is live and running, but an External IP address appears in the site address section instead of domain name. You need to replace that External IP address with your domain
Let’s get started!
Steps to Set Up a domain on Google Cloud Platform
Register your domain or Login into your domain provider account
Log in to the Google Cloud Console
Enable the Cloud DNS API on GCP
Create a Cloud DNS Zone
Add DNS Records (Setting Up A Record)
Add DNS Records (Setting Up CNAME Record)
Configure NS Record in Your Domain Provider
Congratulations! You’re done setting up your custom domain with Google Cloud Platform.
Now type your website on any web browser and you will be able to see your WordPress website live. If you can’t see your website, don’t panic. Any changes made to your domain nameservers (DNS) might not reflect immediately. It could take up to 24 hours, so wait for some hours and try again later.
However, only pointing a domain with Google Cloud Server isn’t enough. We need to do a few more changes for proper domain configuration, like Static IP address Configuration on GCP and Domain setup for CMS, to prevent access via IP address.
Reserve and Configure a Static IP address on GCP
I hope that before domain set up, you already reserved and configured static IP on GCP. If you missed the step, then learn here – How to Configure and Reserve a Static IP address on VM Instance of Google Cloud Platform. This set up is very important cause at Google Cloud, VM Instances are launched with an Ephemeral IP address by default, which means this IP address changes every time whenever the server is stopped or restarted. That’s why to prevent our website from technical errors, we need to reserve a Static IP address instated of the default IP address.
Domain setup for CMS
After setting up your domain on Google cloud Server, you need to configure your domain name your CMS so that it can works properly. In our case, we are using WordPress as our CMS. So here you can find – How to Configure a Domain for WordPress on Google Cloud. The process will be similar for other CMS. So don’t worry if you are using a different CMS platform.
So in this tutorial, you learned how to point your domain on Google Cloud. If you have any questions regarding this tutorial, then feel free to let me know by commenting below, and I’ll get back you as soon possible.