Guides

Cloudflare configuration, deployment and rollback

Only production KV, R2, Queue and D1 resources are bound.

Bindings

Only production KV, R2, Queue and D1 resources are bound. The Worker also binds Workers AI, Images, assets and its self-reference. Cron schedules enqueue eligible published catalogs; queue consumers run bounded HTTP/DNS health checks and evidence-backed verification with retry/backoff. The remote development Worker environment has been removed from Wrangler configuration.

Required secret:

Terminal
npx wrangler secret put ADMIN_TOKEN

Optional integration secrets:

Terminal
npx wrangler secret put CLOUDFLARE_API_TOKEN
npx wrangler secret put CLOUDFLARE_ACCOUNT_ID
npx wrangler secret put CLOUDFLARE_ZONE_ID
npx wrangler secret put GITHUB_TOKEN

The Cloudflare token is needed only for provider-private inspection and confirmed DNS mutation. Use least privilege. Repository integration degrades to Not configured while GITHUB_TOKEN is absent.

Release

  1. Run every validation command in the README.
  2. Inspect pending D1 migrations and create a database backup/export appropriate to the account plan.
  3. Apply migrations and read back catalog/environment counts.
  4. Deploy production and verify the custom domain independently from the Worker upload.
Terminal
npx opennextjs-cloudflare build
npx wrangler deploy --dry-run --env=""
npx opennextjs-cloudflare deploy --env=""

Cron changes can take time to propagate. A successful upload does not prove DNS, TLS or custom-domain routing; verify those separately with authoritative DNS and HTTPS requests.

Infrastructure operations and rollback

DNS dry run stores current observations, planned record/route and rollback guidance. Execution requires the same stored operation and its one-time confirmation token. If post-change verification fails, stop further changes and restore the captured prior record/route using Cloudflare change history. Record the incident and audit event.

For an application rollback, use Cloudflare Workers Versions/Deployments to route traffic to the last verified version. Database migrations are additive; do not drop normalized tables during a Worker rollback. If a migration itself must be reversed, create a forward corrective migration after exporting the affected tables.

Last updated 2 November 2026