Create a Custom Domain for your Heroku App
Clack Tibbs from Unsplash.com

Create a Custom Domain for your Heroku App

So you've deployed your app on Heroku, but a URL of crowned.prawn.herokuapp.com doesn't exactly scream professional. If you want to make a custom domain name using Google Domain, here are the steps:

Pre-reqs:

  • Deployed Heroku App
  • Google Domain

Step 1: Buy a Domain Name

I'm using Google Domain but you can also use something like NameCheap.com.

  1. Go to https://domains.google/#/ and login to your account.
  2. Search for your desired domain name, add to cart, and then buy it at check-out. The domain price depends on the name that you get. $12.00/year is good benchmark price.

3. Congratulations! We just bought "foo-bar-bizz-fuzz-bit.com." Now click on the upper-left hamburger and go to DNS.

Step 2: Link your app to your domain

1. Scroll down to Synthetic records inside of DNS. This is where you'll redirect any subdomain to the domain that you just bought. Fill in an "@" sign for the Subdomain textbox and "www.yourDomainName.com" for your Destination URL.

The example above will be "@" and "www.foo-bar-bizz-fuzz-bit.com"

5. Scroll down to Custom resource records. This is where the linking happens. You want to get the DNS Target URL from Heroku. There's a couple of ways to do that:

  • On the terminal: You can change directory (cd) to the root file of your app and enter the command "heroku domains". This should give you something like this:
  • On Heroku: You can go to your Heroku App Settings. Scroll down to "Domains and Certificates" and you can add a domain there. Copy and paste the DNS Target.

6. Fill in the required items on Custom resource records at the Google Domain website.

Step 3: That's it! All that's left is to check your new domain.

Depending on your configuration, your app may go online ASAP or take as long as 72 hours. As soon as I stopped misspelling and type the correct fields in, I was able to see the live version of my custom domain website.

I hope this article helped someone! I wrote it to remind my future self of the entire process. Let me know if you have questions.









要查看或添加评论,请登录

Trisha Aguinaldo的更多文章

  • "Tres Gatos" - A Symphony of Cats and Flowers

    "Tres Gatos" - A Symphony of Cats and Flowers

    Months ago, I took on my first-ever cat portrait commission—my sibling’s cat, Lilith. Let’s just say it didn’t exactly…

  • I Help Other Artists Tidy Up Their Studios

    I Help Other Artists Tidy Up Their Studios

    Not long ago, I found myself knee-deep in paint tubes and brushes, helping a client reorganize her newly renovated art…

  • Teaching Girls To Code (Boston)

    Teaching Girls To Code (Boston)

    Tonight is my first time facilitating a coding class to a group of 6th-12th grade girls in Boston. I arrive at the…

    2 条评论

社区洞察

其他会员也浏览了