Viewing Domains

To see the domains currently associated with your application:

dokku domains my-app-name

You should see at least a healthcareblocks.com subdomain. Do not remove this entry.

Adding Domains

Next, you will need to add your actual domain name in order for Dokku to correctly route traffic to your application:

dokku domains:add my-app-name www.mydomain.com

Your domain name registrar typically provides domain name system (DNS) management functionality. There are also third-party DNS services (e.g. CloudFlare and Zerigo) that include additional benefits. You'll need to create the following DNS record to point your actual domain to your application:

  • Type: CNAME
  • Name: your domain name
  • Value: your app subdomain + healthcareblocks machine identifier

Raw DNS record example:

www.mydomain.com.    IN    CNAME    my-app.7654321.healthcareblocks.com

Configuring Domains Without the "www" Subdomain

Using a "naked" domain - without a subdomain - is not recommended unless you have purchased a (more expensive) wildcard SSL certificate from a third-party SSL vendor (we don't sell certs) and your DNS provider supports CNAME-like functionality at the zone apex level. However, if you do go down this route, here's what you need to do:

First check if your DNS provider supports ALIAS or ANAME records. Then create an entry there pointing the empty or @ value to your Dokku hostname (e.g.my-app.7654321.healthcareblocks.com above).

Finally, make Dokku aware of the root domain:

dokku domains:add my-app-name mydomain.com

Using a Load Balancer

For high availability environments using a load balancer, you will also need to make Dokku aware of the load balancer URL, example:

dokku domains:add my-app-name load-balancer-dns-name.my-domain.com

We also recommend that the TTL for the domain pointing to the load balancer is set to 60 seconds. A lower cache period results in traffic being more evenly distributed.