You'd like to create custom subdomains for each of your users, like
We expect that most customers requesting a limit increase will be adding and managing domains programmatically using the Heroku API. However, adding and managing domains for an app can also be done within the "Settings" tab of the app's Heroku Dashboard.
Request a custom domain limit increase
There is currently a limit of 1,000 domains per app. This limit can be raised by the Heroku Support team if you submit a support ticket requesting an increase. Please provide details about your use case and suggest a new limit in the ticket.
Make use of Heroku's Platform API
We offer several Domain endpoints which make managing an app's domains easy to do programmatically. You will likely need to embed some domain-management logic into your app's code, perhaps something like this:
Get a list of all the custom domains currently in use for the app using the Domain List endpoint.
If the new custom domain to be added is not in this list, use the Domain Create endpoint to add it to the app. You will need to handle the case where the domain to be added is already in use.
If a user cancels their membership with your SaaS product, you can use the Domain Delete endpoint to remove their custom subdomain.
Special notes for SSL certificates
Heroku's Automated Certificate Management (ACM) cannot be used on apps with more than 100 custom domains. There are other known limitations of ACM which cause it to not be a viable option for SSL certificate management in the use case outlined in this article.
If you require SSL for more than 100 custom domains on one app, you have 2 options:
If you need SSL on no more than a couple hundred custom domains, you could use SSL Endpoint "shells" as described in our How do I enable SSL for my app that has more than 100 custom domains? article in the Help Center. This approach is not sustainable beyond a couple hundred custom domains.
You could use a 3rd party solution such as Cloudflare's SSL for SaaS Providers