Skip to content
Home » Part 2: How to set up a site with Cloudflare DNS

Part 2: How to set up a site with Cloudflare DNS

  • by

Anebula is reader-supported. When you buy through links on our site, we may earn an affiliate commission.

This guide is part of the How to host multiple sites on one virtual machine with Docker series where you learn how to create a virtual machine (VM) that is home to multiple websites and apps. In this series, we will host a WordPress blog, a Ghost blog, a Matamo Analytics app, and a lot more!

Disclaimer: I am not affiliated with Cloudflare in any way and I don’t profit from sign-up links or anything like that – I’m simply a happy customer that has been using them for a few years.

As I mentioned in the first post of the series, Cloudflare is an excellent proxy and nameserver that offers a lot of neat features. Cloudflare will sit in front of our Digital Ocean VM or “Droplet” and will provide DDOS protection, anonymity, and caching so that we get an extra level of protection while at the same time serving content more efficiently.

While Cloudflare offers paid services, the free account goes a long way!

Step 1: Create a Cloudflare account

Go to Cloudflare and register a new free account. At the time of registration, there is no distinction between free and paid and you will not have to enter a payment method. This guide will show you all the neat free features of Cloudflare.

Step 2: Add a site to manage

Once we have registered, the next step is to add the site that we purchased in the previous post.

On the logged-in home, click on Add Site (this can be found in multiple places.

Enter the domain name you purchased. In my case, it was “sympatheticdisk.info”

You will be taken to a plan page, scroll to the bottom and click on the Free plan then click on Continue

Step 3: Configure the new domain

Cloudflare will run a quick scan for your current DNS records and then take you to the results page. Since this was a new domain name purchase we can delete all records in here. Under Actions go through all of them and delete them…yes, delete ALL records. We are deleting all records because we don’t want anything pointing to the default locations that Namecheap had set.

Once all records are deleted, you can click Continue.

Confirm to add records later.

Step 4: Copy nameservers from Cloudflare to Namecheap

Now we have arrived! Copy over the Cloudflare nameservers and paste them into Namecheap. Then click the green save checkmark. We are done with Namecheap, you can close this window. The only time you’ll ever need to come back to Namecheap is to verify your mailing address once per year and to renew your domain, other than that we will never need to change anything in Namecheap.

Then go back to Cloudflare and click Done, check the nameserver

Cloudflare will send you to a Quick Start Guide. Click Get Started.

For each step, leave the defaults and hit save, then click Finish

Cloudflare will now verify the nameservers which could take up to 24 hours. In my experience, this usually takes under two hours, so let’s forget about it for now and we’ll come back to it. We have plenty of work to do with setting up the VM, then adding a few docker containers, then we can come back to Cloudflare.

Continue to Part 3: How to create a Droplet VM with SSH on Digital Ocean

Leave a Reply

Your email address will not be published. Required fields are marked *

five × 4 =