Skip to main content

Custom Domains

Connect your own domain name to any Runtime deployment with automatic SSL certificates.

How it works

  1. You add a CNAME record pointing to your Fly app
  2. Fly.io handles SSL certificate provisioning via Let’s Encrypt
  3. Traffic flows through Fly’s edge to your app

Adding a Domain

Via CLI

Via API

DNS Configuration

After adding a domain, configure DNS at your registrar.

Subdomains (CNAME)

For subdomains like api.example.com or app.example.com:

Apex Domains

For apex domains like example.com (without subdomain), use A records pointing to Fly.io IPs. Contact support for apex domain setup.

SSL Certificates

Certificates are automatically provisioned via Let’s Encrypt:
  1. You add the domain
  2. Runtime creates a certificate request
  3. DNS is verified (you configure the CNAME)
  4. Certificate is issued (~1-5 minutes after DNS propagates)

Certificate Status

Check certificate status:

Complete Workflow

1

Deploy your app

2

Add custom domain

3

Configure DNS

Add CNAME record at your registrar:
  • Name: api
  • Value: your-app-xyz.fly.dev
4

Wait for propagation

DNS changes typically propagate in minutes but can take up to 48 hours.
5

Verify

Visit https://api.example.com when status shows issued.

Multiple Domains

You can add multiple domains to a single deployment:

Removing a Domain

This removes the domain configuration and certificate. Don’t forget to also remove the DNS record at your registrar.

DNS Verification

Check DNS Propagation

Expected output:

Online Tools

Common DNS Providers

  1. Go to DNS settings
  2. Add CNAME record
  3. Set proxy status to “DNS only” (gray cloud)
Disable Cloudflare proxy (orange cloud) to avoid certificate conflicts.
  1. Go to DNS Management
  2. Add CNAME record
  3. Name: api, Value: your-app.fly.dev
  1. Go to Advanced DNS
  2. Add new record → CNAME
  3. Host: api, Target: your-app.fly.dev
  1. Go to Hosted Zones
  2. Create Record
  3. Type: CNAME, Value: your-app.fly.dev

Troubleshooting

  1. Verify DNS is configured correctly:
  2. Wait up to 48 hours for DNS propagation
  3. Ensure no conflicting A/AAAA records exist
Custom domains only work with ready deployments:
Wait for deployment to complete, then add domain.
Common causes:
  • Cloudflare proxy enabled (use DNS-only mode)
  • Wrong CNAME value
  • DNS not propagated yet
Try removing and re-adding the domain:
If you destroyed and recreated a deployment, the domain may point to the old app. Update the CNAME to the new Fly.io URL.

Best Practices

Subdomains (api.example.com) are easier to configure than apex domains.
Add a test domain (staging.example.com) before production.
Use low TTL (300 seconds) during setup, increase after confirmed working.
Keep a record of which domains point to which deployments.