How do I connect a custom domain to my Replit app?
How do I connect a custom domain to my Replit app?
If you bought your domain through Replit, the DNS records are managed for you—open Publishing → Domains and follow the in-product setup. See Domain purchasing.To connect a domain from an external registrar:
- Open your project and go to Publishing → Domains.
- Select Connect your own domain, enter your domain, and continue.
- Replit shows an A record and a TXT record—copy both.
- Add both records at your DNS provider.
- Return to Replit and start verification.
- Both an A record and a TXT record are required for SSL. Apex (root) CNAMEs aren’t supported—use an A record for your root domain.
- Wildcard certificates (
*.example.com) aren’t supported; connect each subdomain individually. - On Cloudflare, set your A record to DNS only (the grey cloud) so proxy mode doesn’t block SSL setup.
- DNS changes can take up to 48 hours to propagate.
My domain isn't verifying or SSL isn't provisioning—how do I troubleshoot?
My domain isn't verifying or SSL isn't provisioning—how do I troubleshoot?
Work through these checks in order—most issues come from one of them:
- Wait for DNS to propagate. Changes can take up to 48 hours. Confirm your records are visible globally with a DNS lookup tool.
- Remove AAAA records. IPv6 (AAAA) records on the same hostname as your A record can block SSL.
- Remove old or conflicting A records. Keep only one A record at your root domain pointing to Replit.
- Set Cloudflare to DNS only. The orange cloud (proxy mode) interferes with SSL provisioning.
- Disconnect and reconnect the domain once in Publishing → Domains → Manage to force a fresh certificate, then wait a few minutes and reload. Each reconnect requests a new certificate, so avoid repeated retries. See Retry failed domains safely.
- Check CAA records. If you have CAA records, at least one must allow Let’s Encrypt as an issuer, since Replit issues certificates through it.
Will Replit detect DNS records I add later?
Will Replit detect DNS records I add later?
Yes, for about 6 hours. After you add a domain, Replit checks its DNS records every 1 to 2 minutes for about 6 hours. If your records appear in that window, Replit verifies the domain and issues SSL automatically.After about 6 hours, the domain shows as Failed and Replit stops checking. Confirm your records are correct, then remove the domain and add it again.Add the A record and the TXT record at the same time. Replit can only issue SSL after the A record points to Replit. See How long Replit checks your DNS records.
Why do some subdomains fail to get SSL when I connect many at once?
Why do some subdomains fail to get SSL when I connect many at once?
Replit issues SSL certificates through Let’s Encrypt, which limits how many certificates each domain can get:
- 50 new certificates per registered domain. All subdomains of
example.comshare this limit, including certificates issued by other hosts that use Let’s Encrypt. The limit frees up gradually, about 7 certificates per day. It doesn’t reset all at once each week. - 5 certificates per exact hostname in 7 days. Removing and re-adding the same subdomain always uses this limit. If the subdomain never got a certificate, re-adding it also uses the shared limit of 50.
How do I set up Clerk authentication on a custom domain?
How do I set up Clerk authentication on a custom domain?
A few issues commonly come up when using Clerk authentication on a custom domain:
- “Clerk CNAME records required” warning. This is a Clerk integration requirement and doesn’t block your domain’s verification or SSL. Open Publishing → Domains, select Manage, find the authentication DNS setup section, and add each listed CNAME record exactly at your DNS provider. If the section doesn’t appear, disconnect and reconnect the domain.
- Domain stuck on Verifying after prior Clerk use. If the domain was attached to a different Clerk application, remove it there in your Clerk dashboard, then disconnect and reconnect the domain in Replit.
- Migrating to your own Clerk instance. Switching from Replit-managed Clerk to your own instance requires a manual step—contact Replit Support. See Can I bring my own Clerk app?