@opennextjs/cloudflare adapts Next.js standalone builds to run on Cloudflare Workers with the Node.js compatibility layer.
Overview
OpenNext for Cloudflare is an adapter that lets you deploy Next.js applications to Cloudflare’s developer platform. It takes output from a standard Next.js production build in standalone mode and reshapes it to run in the workerd runtime using Workers’ Node.js compatibility support.
After adding the package, running the adapter’s CLI builds your app via your existing build script, then transforms artifacts for local testing with Wrangler and deployment to Cloudflare. Documentation covers starting new projects through Cloudflare’s scaffolding command and migrating existing apps.
The adapter expects the Next.js Node.js runtime rather than the Edge runtime, which unlocks more APIs and features on Workers. Documented support includes App Router and Pages Router capabilities such as route handlers, SSR, SSG, ISR, middleware, image optimization, partial prerendering, and composable caching, among others listed in the docs.
Compared with the older Cloudflare Pages-oriented adapter that only supported the Edge runtime, this path targets fuller Node.js feature coverage. Windows development is possible but not fully guaranteed; the project suggests WSL, Linux VMs, or building on Linux/macOS CI when native Windows tooling causes friction.
Key features
- Next.js standalone to Workers transform
- Node.js runtime on Cloudflare Workers
- Wrangler-based local run and deploy
- App and Pages router feature support
- ISR and static generation support
- Middleware and image optimization
- Scaffold command for new projects
- npm package installation
Use cases
- Hosting Next.js on Cloudflare Workers
- Migrating existing Next.js apps to Workers
- SSR and API routes on edge infrastructure
- CI-driven deploy from Linux or macOS