π― 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.