Use when it fits · OpenNext (open source), backed by Cloudflare · Server-rendered Next.js

Next.js on Cloudflare Workers (OpenNext)

Server-rendered Next.js without Vercel. The OpenNext adapter runs a normal Next.js build on Workers: SSR, ISR, server actions, middleware and image optimisation.

Warning: Cloudflare now points new Next.js apps at vinext, its own rebuild of Next.js on Vite. vinext calls itself experimental: for production, I'd stay on OpenNext until that changes.

When a client needs server-rendered Next.js and I don't want to add Vercel to the bill, this is how I'd run it: a normal Next.js build, converted by the OpenNext adapter into a Worker. It sits on the same Cloudflare account as everything else, so there's one more Worker, not one more platform.

It's a translation layer, not Next.js's home. New features land on Vercel first and reach the adapter later, and a few aren't there yet. For most apps that doesn't matter. If it does, Vercel is the honest answer.

Use it when

  • A Next.js app that must render pages per request or per user: dashboards, personalised pages, logged-in areas.
  • Lots of pages that change one at a time (a shop's products, a CMS): ISR rebuilds only the page that changed.
  • You want Next.js on the stack you already run, not on another platform.

Don't use it when

  • A static site or SPA: Cloudflare static hosting is simpler and free.
  • A content site you're starting fresh: Astro on Workers fits it better.
  • You need every new Next.js feature on day one: Vercel builds Next.js, and the adapter follows. Node middleware (Next.js 15.2 and later) isn't supported yet.
  • A heavy app: a Worker is capped at 10 MB compressed on the paid plan (3 MB free), so a big bundle needs trimming.

Pricing

Workers pricing: Workers Paid is $5 a month with 10M requests and 30M CPU milliseconds included. ISR pages cache in R2.

Gotchas, with fixes

Gotcha: The build goes over the Worker size limit.

Fix: Run npx @opennextjs/cloudflare build and read what's in the bundle; heavy server-only dependencies are the usual cause.

Gotcha: ISR pages serve stale content longer than expected when the cache sits in Workers KV, which is eventually consistent.

Fix: Use R2 for the incremental cache, as OpenNext's docs recommend (and D1 for the tag cache).

Provisioning

Official Pulumi package · Official Terraform provider

The Worker, its R2 cache bucket and routes are ordinary Cloudflare resources. The build itself runs through the adapter's CLI (opennextjs-cloudflare build) before the deploy.

Instead, consider

Where it fits

  • A website, SPA or PWA: Pick 04.

    When it's a Next.js app that needs server rendering, without moving to Vercel.

Sources

Last reviewed by Nicolas Dao

Want this stack in your AWS account?

Cloudless Labs is a Sydney consultancy. We migrate on-premises systems to AWS, build serverless apps on this stack, and coach teams to ship with Claude Code and Codex.

Contact Us

For general inquiries, please contact us at:

For e-learning capabilities, please contact: