Cloudflare is a DNS management service and content delivery network (CDN). Ghost(Pro) users commonly route their DNS through Cloudflare for it's support of root level CNAMEs and flexible redirects, known as Page Rules.

The following steps will walk you through how to setup a root domain with your Ghost(Pro) publication, using Cloudflare to manage your domain's DNS records.

Connect Your Domain to Cloudflare

The first step is to create a free Cloudflare account and follow a few steps. There are paid options available but you only need a free account to setup a custom domain with Ghost.

  • Enter your domain name when creating your new Cloudflare account and it will query your existing DNS records and port them over. Review these records and port any over that are required.

  • Update your Nameserver (NS) with your domain provider to the NS records that Cloudflare requests during the setup process. If you're unsure where to update this you may need to contact your domain provider directly:

Update Nameservers

  • When your Cloudflare Overview shows a status of "Active" you are ready to configure your domain's DNS to point to your Ghost(Pro) publication - this can take a few minutes:

Active Status

Configure your DNS records

The next step is to configure your DNS records for your domain in Cloudflare.

  • Navigate to your domain in Cloudflare and add a CNAME record type:


  • In the "Name" field, enter @ for a root domain configuration. This uses as the default custom domain for your Ghost(Pro) publication.

  • In the IPv4 address, enter the URL for your publication, <subdomain> and add your new CNAME record:

CNAME Record

Redirecting the www subdomain to the root domain

To ensure your publication does not return 404 errors when visitors visit the site with and without the www subdomain, create a second CNAME record for www and point it to

Add Page Rules

Page Rules in Cloudflare are custom redirect patterns which can be used to redirect the www subdomain to the root domain.

  • Create a page rule and enter the following URL pattern:*.
  • Set the destination URL to "Fowarding URL":
  • Set the status code as "301 - Permanent Redirect":
  • In the destination URL field, enter the following URL pattern:$1
  • Create a second page rule and enter the following URL pattern:*
  • In the destination URL field, enter the following URL pattern:$1

Once your new Page Rules are saved and deployed, all traffic to and will be redirected to

Domain Activation

The final step to complete your custom domain setup is to go back to and activate your custom domain.

  • Log into your account at and setup a custom domain in the "Domain Settings" section.

  • Enter the domain into the custom domain field on, making sure to include www when entering the domain. For example,

Activate Custom Domain

  • Activate your custom domain - this can take anywhere from a few seconds to a few hours due to the length of time your DNS takes to propagate.

  • Once activated, you can view your publication by going to the custom domain directly from the browser.


Great work! 🤓 You successfully setup a root domain and a subdomain redirect with your Ghost(Pro) publication through Cloudflare. Regardless of how a user enters your publication's URL in their browser, they'll always be directed to the correct site.

If you're having trouble getting your custom domain to activate, drop a message for help.