How to Set Up A Custom Domain on Heroku


For this post, I’m going to use DreamHost as the domain provider. This process is usually similar for other domain providers as well.

Step 1: Purchase Domain

The first step is to purchase the domain. I use DreamHost for my domain purchases.

Step 2: Point CNAME

    1. Log in to DreamHost
    2. Click on Manage Domains
    3. Click on “DNS” of the domain you want to use
    4. Under “Add a custom DNS record to [your domain]:”
      • Type in “www” for Name
      • Select “CNAME” for Type
      • Type in your Heroku app URL ( for Value
    5. Click “Add Record Now!”

Step 3: Redirect Root Domain to WWW

This step is necessary to redirect anyone trying to reach your root domain.

  1. Go to Manage Domains
  2. Edit your domain
  3. Under Redirect, redirect to

Step 4: Add Domain to App

Next you will want to add the domain to the Heroku app. You can do this from the Heroku web panel or the command line.

From the command line:

$ heroku domains:add

Step 5: Wait

Don’t stress out. It usually takes a while before things start to work because of DNS propagation or whatever.

If you don’t want to use a subdomain, and would prefer root domain, vs, you would would have to go with another DNS provider like DNSimple and use the ALIAS record type instead of CNAME. Though it is more expensive because of monthly fees.