Heroku + Rails: How to allow my Users to add their own Custom Domains Heroku + Rails: How to allow my Users to add their own Custom Domains heroku heroku

Heroku + Rails: How to allow my Users to add their own Custom Domains


Here's one solution to allow this:

  1. Set up a wildcard subdomain (for your app's domain) that points to your Heroku app.
  2. Allow users to set a custom subdomain.
  3. Users can then set up a CNAME (or ALIAS or ANAME, as described here) that points to their custom subdomain on your app.


Yep, it's definitely possible - you have to use the Heroku gem within your application and when they add domains you need to make an API call to add their chosen custom domain to your application.

If you want to be able to use SSL it won't work AFAIK because you can only have one SSL addon per app - however, subdomains are easier since you can do a wildcard subdomain and then it's also possible to use a wildcard SSL on your domain without having to involve making API calls and you then don't have to get your clients edit their DNS to point at your application.