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.
bun run build
bun run deployThe 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.
- Add the zoneAdd the domain to the Cloudflare account and follow the nameserver change.
- Attach the domainAttach the custom domain to the Worker in the Cloudflare dashboard or with wrangler.
- 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.
bunx wrangler secret put DODO_PAYMENTS_API_KEY