Custom Domains
Connect your own domain name to any Runtime deployment with automatic SSL certificates.How it works
- You add a CNAME record pointing to your Fly app
- Fly.io handles SSL certificate provisioning via Let’s Encrypt
- 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 likeapi.example.com or app.example.com:
Apex Domains
For apex domains likeexample.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:- You add the domain
- Runtime creates a certificate request
- DNS is verified (you configure the CNAME)
- 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
https://api.example.com when status shows issued.Multiple Domains
You can add multiple domains to a single deployment:Removing a Domain
DNS Verification
Check DNS Propagation
Online Tools
- whatsmydns.net - Check global propagation
- dnschecker.org - Multi-location DNS check
Common DNS Providers
Cloudflare
Cloudflare
- Go to DNS settings
- Add CNAME record
- Set proxy status to “DNS only” (gray cloud)
GoDaddy
GoDaddy
- Go to DNS Management
- Add CNAME record
- Name:
api, Value:your-app.fly.dev
Namecheap
Namecheap
- Go to Advanced DNS
- Add new record → CNAME
- Host:
api, Target:your-app.fly.dev
Route 53 (AWS)
Route 53 (AWS)
- Go to Hosted Zones
- Create Record
- Type: CNAME, Value:
your-app.fly.dev
Troubleshooting
Certificate stuck in 'pending'
Certificate stuck in 'pending'
- Verify DNS is configured correctly:
- Wait up to 48 hours for DNS propagation
- Ensure no conflicting A/AAAA records exist
'Deployment not ready' error
'Deployment not ready' error
Custom domains only work with Wait for deployment to complete, then add domain.
ready deployments:Certificate verification failed
Certificate verification failed
Common causes:
- Cloudflare proxy enabled (use DNS-only mode)
- Wrong CNAME value
- DNS not propagated yet
Domain shows old deployment
Domain shows old deployment
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
Use subdomains
Use subdomains
Subdomains (
api.example.com) are easier to configure than apex domains.Test with staging domain first
Test with staging domain first
Add a test domain (
staging.example.com) before production.Keep TTL low initially
Keep TTL low initially
Use low TTL (300 seconds) during setup, increase after confirmed working.
Document your DNS setup
Document your DNS setup
Keep a record of which domains point to which deployments.