Custom domains for SaaS – customer CNAME → my domain → Railway app (SSL & scaling)
mailtestlaa-eng
FREEOP

18 days ago

Hello Railway Support Team,

I’m building a SaaS product on Railway that supports customer-provided custom domains.

Current setup

  • My Railway service is live at:
    domain-viewer-production.up.railway.app

  • I have my SaaS domain configured as a custom domain in Railway:
    custom1.testlaa.com → CNAME → domain-viewer-production.up.railway.app

  • HTTPS is working correctly on custom1.testlaa.com.

Intended SaaS flow

For each customer:

  1. Customer adds a CNAME record:
    customer-domain.comcustom1.testlaa.com

  2. My app routes tenants based on the Host header.

  3. The customer domain should load securely via HTTPS.

Questions / clarifications needed

  1. Is this CNAME chaining approach (customer-domain.comcustom1.testlaa.com*.up.railway.app) fully supported by Railway?

  2. For HTTPS to work, do I need to manually add every customer domain as a Custom Domain in the Railway dashboard?

  3. Is there any API or automation support for adding/verifying custom domains and SSL certificates for SaaS use cases?

  4. Are there any limits or best practices (rate limits, domain count limits, SSL issuance limits) I should be aware of?

  5. Does Railway plan to support wildcard or managed SaaS custom domains in the future?

My goal is to provide a smooth self-serve custom domain experience for customers while staying within Railway’s supported architecture.

Thanks in advance for your guidance.

Solved

1 Replies

sam-a
EMPLOYEE

18 days ago

CNAME chaining through your intermediate domain won't work for SSL - each customer domain must CNAME directly to Railway and be added as a custom domain in the dashboard for us to issue a certificate. You can automate this using our Public API with the customDomainCreate mutation. However, the Hobby plan is limited to 2 custom domains per service. For a SaaS with many customer domains, you'd need Pro (20 domains by default, can be increased on request). Wildcard domains are supported if you want customers to use subdomains of your domain instead (e.g., *.testlaa.com). We don't currently have a fully managed SaaS custom domain feature that auto-provisions SSL for arbitrary customer domains.


Status changed to Awaiting User Response Railway 18 days ago


Railway
BOT

11 days ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway 11 days ago


Loading...