Skip to content

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.

  1. Go to the Cloudflare dashboard → Workers & Pages.
  2. Click your Worker (e.g. kilat).
  3. Go to Settings → Domains & Routes.
  4. Click Add Custom Domain (or Add Route).
  5. Enter your domain, e.g. kilat.example.com.
  6. 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.

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.

If you use Google OAuth, add the new callback URL in the Google Cloud Console:

https://kilat.example.com/auth/google/callback

You can keep the old *.workers.dev URI as well for staging.

Terminal window
bun run build
wrangler deploy

The 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.