Root Domain Setup Using Cloudflare

What is Cloudflare?

Cloudflare is a DNS management service and content delivery network (CDN). It provides a great deal of tools for managing your DNS and super charging your site. Ghost is partnered with Cloudflare, and all Ghost(Pro) blogs automatically receive the benefits of Cloudflare’s CDN.

Creating a Cloudflare account

  1. To create a Cloudflare account, go to https://www.cloudflare.com/a/sign-up and follow the prompts to get started.
  2. Add your domain to your Cloudflare account and click Begin Scan.
  3. When the Cloudflare DNS scan is complete, click Continue Setup

  4. Verify that all of your DNS records are listed with Cloudflare and click Continue
  5. Select the “Free” plan and click Continue.
  6. Next, update your NS records with your domain registrar to the records that Cloudflare requires and click Continue.

Once through the Cloudflare setup process, you should be able to manage your domain through Cloudflare.

Connecting your domain to Ghost(Pro) - Root domain setup (yourdomain.com)

  1. Click DNS from the icons at the top of your Cloudflare toolbar.
  2. Add the following DNS record to point to your domain at your Ghost(Pro) blog:
    @ CNAME yourblog.ghost.io

  3. Create a second DNS record to point the subdomain to the root domain:
    www CNAME yourdomain.com

Redirect the subdomain to the root domain.

  1. Click on Page Rules

  2. Click Create Page Rule
  3. Enter the subdomain version of your domain in the first URL field, www.yourdomain.com/*
  4. Click +Add a Setting

  5. Select Forwarding URL from the dropdown that appears.
  6. Select 301 - Permanent Redirect from the Select Status Code dropdown.
  7. Enter in yourdomain.com/$1 as the destination URL.
  8. Click Save and Deploy

Update your Ghost.org publication settings

With the Cloudflare DNS records added, the final step to setting up your custom domain would be to update Ghost.org.

  1. Log into your ghost.org account.
  2. Access your publication management settings by clicking the dropdown menu arrow to the right of "Owner"
  3. Select Domain from the list of options.
  4. Enter your domain into the Custom Domain field.
  5. Click Save.