Skip to content

Domains & HTTPS

Add a custom domain with free automatic HTTPS

Point your own domain at a DployHub app with a CNAME record. HTTPS certificates are issued and renewed automatically, with HTTP redirected to HTTPS.

Updated 2 min read

Every app works at its apps.dployhub.com address from the start, but you will usually want your own domain, such as www.example.com. You can attach a custom domain to live, to staging, or to both, and we take care of the HTTPS certificate for you.

Add the domain in DployHub

  1. 1

    Open the Domains tab

    Open the app, go to Domains and choose the environment: live or staging.

  2. 2

    Enter the domain

    Type it on its own, for example www.example.com. Do not include https:// or a path.

  3. 3

    Note the target address

    The tab shows the environment address your DNS record must point to, for example shop.apps.dployhub.com for live.

Add a CNAME record at your DNS provider

Sign in where your domain DNS is managed (your registrar or DNS host) and add a CNAME record:

text
Type:   CNAME
Name:   www
Value:  shop.apps.dployhub.com

For staging you might use staging.example.com with the value shop-staging.apps.dployhub.com. Remove any old A or CNAME record for the same name first, because conflicting records stop the new one from working.

HTTPS is automatic

Once your DNS points to us, an HTTPS certificate is issued automatically, usually within minutes, and renewed before it expires. DNS changes can take up to 48 hours to spread, so be patient if the domain does not work right away. Plain HTTP requests are redirected to HTTPS.

Root domains like example.com

Most DNS providers do not allow a CNAME on the root (apex) of a domain. You have two options:

  • Use www.example.com as your app domain, and set up a redirect from example.com to www.example.com at your registrar. This works everywhere.
  • If your DNS provider supports CNAME flattening or an ALIAS record, point the root domain at your environment address with that record type.

Rules to know

  • A domain can be attached to only one app and one environment at a time. Remove it from the old one before adding it elsewhere.
  • Your app address keeps working after you add a domain.
  • Django apps must list every domain they serve in ALLOWED_HOSTS, including your custom domain.

If the domain still is not working after DNS has had time to update, follow Domain not working, and raise a ticket in the Domain/HTTPS category if you need help.

Frequently asked questions

Do I need to buy an SSL certificate?

No. HTTPS certificates are issued and renewed automatically and free once your DNS points to us.

How long until my domain works?

Usually minutes after the CNAME is in place, but DNS changes can take up to 48 hours.

Can I use example.com without www?

Only if your DNS provider supports CNAME flattening or ALIAS records. Otherwise use www and redirect the root to it.