🎯 What’s the goal? Assign your domain to your GCP Hosting account. | ⚠️ Why does it matter? So your domain name redirects to the server hosting your website. |
🏁 What’s the result? Your domain name points to your GCP account. | ⌚ When do you do this? Ideally as soon you put your website online, only once. |
✅ Any special requirements? You need to have your own domain name (SOP005) and GCP Server. | 🙋♂️Who should do it? Owner of the website or the person in charge of managing it. |
👉 Where this is done: On Cloudflare.com and in Google Cloud Platform Admin Console.
⏳ How long will this take? about 15 minutes
Let’s get started, in 15-min you will be able to access your website not using its IP address but with its unique domain name.
Environment setup:
- We recommend that you use Google Chrome browser to navigate the web.
- Access to your Google Cloud Platform Admin Panel,
- Access to your domain setting.
Creating Account on Cloudflare.com
- Go to www.cloudflare.com.
- Click on “Sign Up”.
- Enter your “Email” address.
- Then come up with a “Password” – it needs to fulfill the criteria underneath.
- Finally, click on “Create Account”.
After creating your Cloudflare Account go check your email. You should receive one from Cloudflare to verify your Email.
Open it and click on the provided link to finish the verification.
Connecting your domain with GCP
- After verifying your email address go back to www.cloudflare.com.
- Click on “Log In”.
- Enter your “Email” and “Password” and click on “Log in”.
- After you log in you should see that “You currently don’t have any websites”.
- Click on “+ Add Site”.
- Enter your site (the domain you bought – e.g. “sitename.com”).
- Then click on “Add site”.
- Choose the “Free” plan.
- Then click on “Confirm plan”.
- Now you should see DNS records for your domain. You have to change highlighted “Value” to your website Public IP address. Leave this page open in your browser.
Getting your IP address from Google Cloud
- Open another tab in your web browser.
- Go to your Google Claud Panel.
- Click on the burger “menu button” in the top left corner.
- In the menu navigate to “Compute Engine”, then click on “VM instances”.
- And there is your IP address. Copy it.
- Go back to “Cloudflare” and paste copied IP it in the place of highlighted value.
- After editing it should look like this (of course with your personal “IPv4 Public IP”).
- Click on “Continue”.
Changing your Nameservers
- After clicking on “Continue” you will be presented with new “nameservers” for your domain. For this SOP we bought a domain on GoDaddy.com so we will show how to change your “nameservers” on Godaddy.com. Cloudflare will always tell you which “nameservers” must be replaced no matter where you bought your domain. Option to manage “nameservers” will always be under “DNS” settings.
For the purpose of this SOP, we will operate on a domain from GoDaddy.
Check our SOP005 to find out how to buy a domain.
- Leave Cloudflare open and in another tab of your browser go to godaddy.com.
- Click on “Sign In”.
- Enter your account data and press on “Sign In” or choose to sign in with “Google” if you used it to create an account on GoDaddy.com.
- After you sign in you should see the domain that you bought. Click on “DNS” to access DNS settings.
- Now you should see the “Nameservers” page. Click on “Change”.
- Then “Enter my own nameservers (advanced)”.
- Now you should see two boxes called “Nameserver 1” and “Nameserver 2”. Leave this page opened.
- Go back to Cloudflare.com and copy “Nameserver 1”.
- Now go back to GoDaddy.com and paste it into the “Nameserver 1” box.
- Now you should do the same for “Nameserver 2”. Go back to Cloudflare and copy “Nameserver 2”.
- Then go back to GoDaddy.com and paste it into the “Nameserver 2” box.
- Click on “Save”.
- After saving, refresh the GoDaddy.com page.
- And as you can see your domain now is “Using custom nameservers”.
- After that go back to Cloudflare.com and click on “Done, check nameservers”.
You’re all set now and your audience can finally access your website using its own unique domain name. This is a major step in building your online brand.