Linking Your Custom Domain to a Heroku App: A Step-by-Step Guide with Godaddy Example

Raghavendra S
2 min readJul 29, 2023

--

Photo by Martin Martz on Unsplash

Introduction:

Are you looking to connect your GoDaddy domain to your Heroku app? Look no further! In this detailed blog post, we will walk you through the process, step by step. By the end, you’ll have your custom domain up and running smoothly. Let’s get started!

Step 1: Checking Available Domains

First, open your terminal and navigate to your Heroku app’s folder. Use the command `heroku domains` to check the available domains for your app. This will provide you with important information for the next steps.

Step 2: Adding a Custom Domain to Your Heroku App

To add a custom domain, follow these steps:

  1. Sign in to your GoDaddy account and go to the “DOMAINS” section.
  2. Choose the domain you want to link to your Heroku app and click on it. This will take you to the Domain Details page.
  3. Click on the “DNS Zone File” tab.
  4. Locate and remove the CNAME record named ‘www’ (which points to ‘@’).
  5. Click on “Add record” and select CNAME (Alias).
  6. Set the ‘Host’ as ‘www’ and the ‘Points to’ field as your Heroku app address (e.g., myapp.herokuapp.com). You can leave the TTL as 1 hour.
  7. Save the changes.

Note: DNS propagation may take some time. It typically takes around 10 minutes, but it can vary.

Step 3: Creating a Naked Domain (Optional)

If you want to use a naked domain (e.g., mywebsite.com) without the ‘www’ prefix, follow these additional steps:

  1. In the same window as before, click on the “Settings” tab.
  2. Under “Forwarding,” click on “Domain” and then click on “Manage.”
  3. Click on “Add Forwarding.”
  4. Set the “Forward to” field as ‘www.example.com’ (replace ‘example.com’ with your domain).
  5. Choose “301 (Permanent)” as the “Redirect type” and select “Forward only” for the “Forward settings.”
  6. Make sure to check the option “Update my nameservers and DNS settings to support this change. (Recommended).”
  7. Save the changes.

Congratulations! You have successfully linked your GoDaddy domain to your Heroku app. Now, your app will be accessible through your custom domain.

Additional Information:

For more information and advanced configurations, you can refer to the official Heroku documentation on custom domains at https://devcenter.heroku.com/articles/custom-domains.

Please note that with the retirement of Bamboo’s EOL proxy.heroku.com, applications using the Bamboo stack should now use the ‘yourapp.herokuapp.com’ mapping as well.

Conclusion:

By following the steps outlined in this blog post, you have learned how to connect your GoDaddy domain to your Heroku app. This process allows you to have a personalized and professional web presence. Enjoy the seamless integration between your domain and your Heroku app, and make the most out of your online presence. Happy coding!

--

--