Skip to content
All guides

Deployment

Deploy to Cloudflare Workers, configure the D1 binding, the custom domain and the payment environment.

Updated 2026-10-21

Workers hosting

The application is built for the Cloudflare Workers runtime through the OpenNext adapter. The Wrangler configuration declares the runtime, the D1 binding and the compatibility flags.

terminalbash
bun run build
bun run deploy

The D1 binding

The D1 database is bound to the Worker as DB. The application resolves the binding at runtime and falls back to an in memory store only when no binding is present, which never happens in a production deployment.

The custom domain

The domain is registered and served through Cloudflare. A Worker or Pages custom domain is attached to the zone, and the DNS record is created by Cloudflare so the certificate is issued and renewed automatically.

  1. Add the zoneAdd the domain to the Cloudflare account and follow the nameserver change.
  2. Attach the domainAttach the custom domain to the Worker in the Cloudflare dashboard or with wrangler.
  3. VerifyConfirm the certificate is active and the record resolves to the Worker.

Secrets

Secrets are set with Wrangler rather than in a file. A secret is never committed and never printed in a log.

terminalbash
bunx wrangler secret put DODO_PAYMENTS_API_KEY