Domain setting

Here is a step by step guide to setting up your domain and other important settings. We assume your DNS is managed by Namecheap. If you are using a different DNS provider, the steps will be similar.

Add a custom domain to Heroku

Go to the Heroku dashboard, select the app, and go to the settings tab. Then, click on the Add domain button and add your domain.

Add root domain

In the domain name field, add your root domain (e.g. interviewdb.com). Then, click Next button.

Add www subdomain

In the domain name field, add your subdomain (e.g. www.interviewdb.com). Then, click Next button.

Add DNS target

After adding the domain, Heroku will provide you with a DNS target. You need to add both DNS targets to your DNS provider. Go to the Namecheap dashboard, select your domain, if you just registered the domain, you will need to remove the default DNS targets and add the DNS targets provided by Heroku.

  • In the Domain tab, choose Namecheap BasicDNS.
  • Remove any redirect URL and redirect email.
  • Then, go to the Advanced DNS tab.
  • Create an alias record with the @ as the host and the DNS target provided by Heroku.
  • Create a CNAME record with the www as the host and the DNS target provided by Heroku.
  • Save the changes. It might take a few minutes for the changes to take effect.

Create a SSL certificate

To enable SSL, go to the Heroku dashboard, select the app, and go to the settings tab. Then, click on the Configure SSL button and select Automatic Certificate Management (ACM). This will automatically create a SSL certificate for your domain.

Once you visit your domain starting with https for example https://interviewdb.com, you should see a site information button on the left of your address bar, click on it to see the SSL certificate details. And if you see a padlock icon, it means your site is secure.

Continuous Deployment with github

To enable continuous deployment with github, go to the heroku dashboard, select the app, and go to the deploy tab. Then, select the github option and connect the repository. Then, click the enable automatic deploys button.

Next, let's configure your Mailgun account to send and receive emails, which is also required for user authentication and many other functions.

Was this page helpful?