Custom domain
By default your Worker is reachable at https://<name>.<account>.workers.dev.
To serve it from your own domain, use the Cloudflare dashboard — no DNS records
to manually create when using the Custom Domain feature.
Add a Custom Domain
Section titled “Add a Custom Domain”- Go to the Cloudflare dashboard → Workers & Pages.
- Click your Worker (e.g. kilat).
- Go to Settings → Domains & Routes.
- Click Add Custom Domain (or Add Route).
- Enter your domain, e.g.
kilat.example.com. - Cloudflare automatically creates the necessary DNS record and provisions the TLS certificate — usually within minutes.
That’s it. Traffic to kilat.example.com now routes to your Worker at the edge.
Route vs. Custom Domain
Section titled “Route vs. Custom Domain”| Option | When to use |
|---|---|
| Custom Domain | Domain on Cloudflare DNS; fully managed TLS |
| Route | Pattern-based (e.g. example.com/api/*); zone must be on Cloudflare |
Custom Domains are simplest for a full app — one domain, automatic TLS, no wildcard patterns.
Update the Google OAuth redirect URI
Section titled “Update the Google OAuth redirect URI”If you use Google OAuth, add the new callback URL in the Google Cloud Console:
https://kilat.example.com/auth/google/callbackYou can keep the old *.workers.dev URI as well for staging.
Re-deploy
Section titled “Re-deploy”bun run buildwrangler deployThe Custom Domain is active as soon as Cloudflare provisions the certificate. Email reset links and OAuth redirect URIs are derived from the request origin, so no env var change is needed — just re-deploy to pick up the new domain.