Hosting your site on a custom domain

Last modified: March 13th, 2023

Working with a specific static site generator?
Customize CloudCannon's documentation to suit your SSG.

Great! We'll show you documentation relevant to .
You can change this any time using the dropdown in the navigation bar.

Attach your own domain to a site on CloudCannon.

To add a custom domain:

  1. Purchase a domain from a domain registrar
  2. Go to the Site Settings / Custom Domain section for your site
  3. Enter your domain with or without a subdomain in the Domain Name box
  4. Click Add Domain

Once you have added your domain, you will see instructions for configuring your DNS and name servers.

Screenshot of Domain interface with no domain set

Subdomains#

Adding a subdomain is the same as adding a Custom Domain. To add a subdomain:

  1. Go to the Site Settings / Custom Domain section
  2. Enter the domain including the subdomain

Multiple Subdomains#

When there are multiple sites with subdomains on the same domain, a subdomain is delegated as the main domain. All unallocated subdomains redirect to the sites with the main domain. For example:

Visiting any subdomain other than www.example.com or docs.example.com will redirect to www.example.com.

To set a site with a subdomain as the main domain:

  1. Create at least two sites with the same domain and different subdomains

  2. Navigate to the Domain Settings / Redirects

  3. Click Set Main Domain on a site to redirect all unused subdomains there

Screenshot of Domain Redirects interface

Configuring your domain#

Changes to DNS can take up to 48 hours to propagate, depending on the previous TTL set. Test your site is configured correctly with the pingdom DNS checker.

Configuration instructions are shown after adding a domain. There are two choices:

CloudCannon DNS (recommended)

Using CloudCannon DNS allows you to manage your DNS records within CloudCannon. This option automatically provides wildcard SSL certificates for your domain, so all your subdomain sites can be served over HTTPS without extra configuration.

See here for more information about configuring CloudCannon DNS.

External DNS

If you want to manage your DNS records outside CloudCannon, you can use External DNS. See here for more information about configuring external DNS.

If you are using Cloudflare as your DNS provider, you will need to configure your DNS records differently. See our guide for using a Cloudflare Proxy with CloudCannon.

Related Articles

Open in a new tab