OpenNext for Cloudflare
CCCOpen sourceThe adapter that runs a full Next.js app on Cloudflare Workers with the Node.js runtime.
What it is
OpenNext is an open-source project that takes the build output of Next.js and repackages it for hosts other than Vercel. The @opennextjs/cloudflare adapter targets Cloudflare Workers and uses the Workers Node.js compatibility layer rather than the restricted Edge runtime, so server components, route handlers, middleware, ISR and image optimization work as they do locally. The build produces a Worker plus static assets that wrangler serves and deploys; caching backends (KV, R2, D1) are pluggable through a small config file.
The site's one-line start for a new app is npm create cloudflare@latest -- my-next-app --framework=next
--platform=workers; existing apps add the adapter, an open-next.config.ts and a wrangler.toml, then run opennextjs-cloudflare build and opennextjs-cloudflare deploy.
Where it fits in the AI OS
Build, the web layer. It lets the website live on the same platform as the API worker, the database and the storage, which keeps the whole company on one bill, one CLI and one CI pipeline. For agents it means a deploy is a deterministic command, not a dashboard.
Insider notes
membersHow Serge's stack uses it
apps/web, the membership site, is Next.js built with OpenNext and deployed as a Worker; CI runs opennextjs-cloudflare build with the commit SHA as the build id. The question "does OpenNext on Cloudflare hold up in production" was closed when the team found the live bulaev.ai and dozens of sibling sites already running on Next.js 15 + OpenNext + Workers + D1 + R2 through the Co.Actor Scale platform.
Setup in 5 minutes
- In an existing Next.js project:
npm i -D @opennextjs/cloudflare wrangler. - Add
open-next.config.tswith the default export from the docs and awrangler.tomlwithmain = ".open-next/worker.js",assetsandnodejs_compat. - Add scripts:
"preview": "opennextjs-cloudflare build && opennextjs-cloudflare preview","deploy": "... deploy". npm run previewto run the Worker locally with your routes.- Add
.open-nextto.gitignore, thennpm run deploy.
Alternatives
- Vercel — zero-config hosting from the framework's authors; costs scale with traffic and functions.
- Cloudflare Pages with
next-on-pages— the older path, Edge runtime only; being superseded by the Workers adapter. - Astro / SvelteKit on Workers — if you do not need Next.js, their Cloudflare adapters are simpler.
- Self-hosted
next startin a container — Fly.io, Railway or a VPS.