Cloudflare is a fantastic platform and many users choose to use it with GhostStead. Along with a great DNS and other features, Cloudflare provides in depth usage analytics that are invaluable for many sites. As with any powerful application, setting up Cloudflare also offer some challenges since they way Cloudflare works is somewhat different from other platforms. This tutorial explains how to set up GhostStead with Cloudflare proxied DNS using your own domain.
Prerequisite: Create a Cloudflare site
Before you begin you need to create a Cloudflare site that will use GhostStead as an origin server. This consists of the following steps:
- Buy a domain name through a registrar. We suggest NameCheap, but any one will do.
- Add a Cloudflare site
- Point the name servers for your domain to Cloudflare.
See Cloudflare's documentation and the documentation of your domain registrar for further information.
Create an un-proxied CNAME record
Create a CNAME record that points your GhostStead site. If your GhostStead site was 'mysite' and your subdomain was 'www', then the record would look like:
By default, the 'Proxy status' will be 'Proxied'. Click the orange cloud icon to change to DNS temporarily. We'll reset this to proxied later on.
Create a custom domain
Switch over to the GhostStead dashboard and create a custom domain using your domain name. Instructions can be found here for doing so. Essentially all you need to do now, given that you've met the pre-requisites, is to type in your domain name and click 'Add'.
Set you Cloudflare record to proxied
Now that your custom domain is set up, go back your Cloudflare site and change the proxy status. To do so, click the now gray cloud, which will set change the status to 'Proxied' and make the cloud orange again.
Set SSL to Full
Click the SSL/TLS tab on your Cloudflare site and set the value to 'Full'.
This setting ensures that all traffic is encrypted - both from your browser to Cloudflare and from Cloudflare to GhostStead.
That's it! You now have a fully setup Cloudflare site serving your GhostStead instance.