how to set up google domains with heroku and ssl (https)

september 6th, 2020

Some tutorials look outdated so I thought I would create my own. This is what worked for my situation after scouring the internet, referencing various sources, and transferring my domain from domain.com after a few failed attempts.

The total cost of the domain was about $10 and the SSL is through the Heroku Hobby dyno so it is $7 per month.

Let's say your domain is your-domain.com.

If using Django, your allowed hosts in settings.py should include the following:

ALLOWED_HOSTS = [
    ...
    'www.your-domain.com',
    'your-domain.com',
'.your-domain.com',
    ... ]

Heroku Configuration

Google Domains Configuration

The second record may be added already. The dot after each "data" field is important but I believe they are added automatically.

Go to https://www.your-domain.com and your site should be live within a few minutes if not immediately. If it is not, feel free to leave a comment and I will try to help out where I can to solve your problem.

Tags: #tutorial