I wrote a separate article called Organize Your Side Projects with a Single Domain that explains what a side project domain is, and why you should use one.
I highly recommend you read that article first, as this post was originally meant to be just a quick walkthrough at the end of that article, but I decided to separate it into it's own post to keep things short and to the point.
I chose to use Route53 and Heroku in this article because I think they are two of the most popular and easy to use solutions out there, however, even if you use two totally different services, it should be easy enough to follow along and figure out what the minor differences are.
Choose a side project domain
Try to keep it short.
I like the idea of using a ‘username’ style for your side project domain, something you might use on Github or Stack (maybe even something you did use on Github or Stack.)
I went with jhadik307.com
Purchase the domain on Route 53
You don’t have to use Route 53. I chose it because it’s really easy to use, and because I use AWS a lot so it’s nice to have everything consolidated in one place. If you choose to use something else, the steps will be a little different, but it should still be easy enough to figure out.
Assuming you're using Route 53, and you already you have an AWS account setup, visit the Route 53 home page. Once there, type your new domain name under the Register domain section and check if it’s available!
Once you find an available domain, click 'Add to Cart' and follow along with the checkout process to purchase your brand new side project domain!
Come up with a subdomain for your project.
One of the best parts about using a side project domain is that none of the subdomains will be taken! This means you can use whatever subdomain you want, most likely just the name of your project.
I'll be using 'somethingsupercoolijustmade' for mine, but you can feel free to use the name of one of your existing side projects, or to use whatever else you want to as a subdomain!
Add the full domain to your Heroku app
Visit your existing Heroku project or start a new one, then go to the settings tab for your project and find the section ‘Domains and Certificates.’ Once there press 'add domain' and type in the full domain name for your side project (with the subdomain included.)
Copy the DNS Target.
Copy the text found in the DNS Target for your new domain on Heroku (as seen highlighted below.)
Setup subdomain on Route 53
Go to the hosted zones section for your new domain on Route 53 and click ‘Create Record Set.’
Enter the subdomain in the ’name’ field, choose CNAME as the type, and paste the DNS target in as the value.
Note - never copy the protocol (http / https) at the beginning of the domain into the cname value box
Once your done, click create.
Visit your new site!
I hope you enjoyed this article! Feel free to ask any questions or leave your feedback in the comments below!