Back

How to Deploy Next.js Outside Vercel with OpenNext

How to Deploy Next.js Outside Vercel with OpenNext

Vercel is the path of least resistance for deploying Next.js — but it’s not the only path. Whether you’re optimizing costs, working within existing cloud infrastructure, or need more control over your runtime environment, deploying Next.js outside Vercel is a well-supported option in 2026.

This article covers the main approaches: native self-hosting and platform adapters via OpenNext.

Key Takeaways

  • Next.js supports multiple self-hosting approaches — Node.js server, Docker container, and standalone output — giving you full control without any adapter.
  • OpenNext adapts Next.js build output for serverless and edge platforms, with strong support for AWS Lambda and Cloudflare Workers.
  • The Deployment Adapter API introduced in Next.js 16.2 provides a stable, versioned contract that adapters can consume directly.
  • Choose self-hosting for container-based teams, OpenNext + AWS for serverless scale, and OpenNext + Cloudflare for edge-first, low-latency delivery.

You Don’t Always Need an Adapter

Before reaching for OpenNext, it’s worth knowing what Next.js supports out of the box.

Next.js officially supports self-hosting via a Node.js server, Docker containers, or static export, with standalone output commonly used to optimize container deployments, as documented in the self-hosting guide.

  • Node.js server — run next start behind a reverse proxy like Nginx
  • Docker container — package your app with a Dockerfile and deploy to any container platform (ECS, Cloud Run, Fly.io)
  • Standalone output — a minimal build artifact that bundles only what’s needed, ideal for containers

These approaches give you full control and work well for teams already running containerized workloads. The tradeoff is that you’re responsible for scaling, caching coordination across instances, and CDN configuration yourself.

If you need ISR, on-demand revalidation, or streaming to work correctly across multiple instances, those functional requirements need to be wired up explicitly — they don’t come for free outside a managed platform.

What OpenNext Adds

OpenNext is an open-source project that adapts Next.js build output for serverless and edge platforms. It started in 2023 as an AWS Lambda adapter from the SST community and has since expanded to Cloudflare and Netlify.

The core idea: Next.js produces a structured build output, and OpenNext maps that output onto each platform’s primitives — Lambda functions, Workers, CDN rules, and cache layers.

The Deployment Adapter API (Next.js 16.2+)

OpenNext’s work directly influenced a major ecosystem shift. In collaboration with Vercel, Cloudflare, Netlify, AWS Amplify, and Google Cloud, the community established a stable Deployment Adapter API in Next.js 16.2.

Previously, platforms had to reverse-engineer Next.js build output — a fragile process that broke with each release. Now, Next.js produces a typed, versioned description of your app: routes, static assets, caching rules, and runtime targets. Adapters consume this contract directly.

As Philippe Serhal from Netlify put it: “The common thread among 90% of our issues was simply the lack of a documented, stable mechanism to configure and read build output.” That’s now solved upstream.

Vercel’s own adapter uses this same public contract — no private hooks.

Deploying to AWS and Cloudflare with OpenNext

Next.js AWS Deployment

The OpenNext AWS adapter, maintained by the SST community, maps your Next.js app to Lambda functions with CloudFront for CDN and S3 for static assets. It handles ISR revalidation and cache synchronization across serverless instances — the parts that are genuinely hard to wire up manually.

Next.js Cloudflare Workers Deployment

The Cloudflare adapter, maintained by the Cloudflare team, converts your app into a format compatible with Cloudflare Workers. For new or existing apps, the recommended setup typically involves initializing or migrating a project using the adapter tooling, as described in the Cloudflare adapter docs.

One important note: the build transformation takes time, so the adapter isn’t meant for active development iteration — use next dev for that, then build when you’re ready to deploy.

Choosing the Right Approach

ApproachBest For
next start / DockerExisting container infrastructure, full control
OpenNext + AWSServerless scale, Lambda-native teams
OpenNext + Cloudflare WorkersEdge-first, global low-latency

The new Adapter API means adapters are converging on a shared compatibility layer and test suite, improving consistency across platforms when evaluating support for features like streaming SSR or Partial Prerendering.

Conclusion

Deploying Next.js outside Vercel is no longer a workaround — it’s a first-class option. Native self-hosting covers straightforward cases. For serverless and edge deployments, OpenNext provides robust adapters for AWS and Cloudflare, now built on a stable, officially supported API. Pick the approach that fits your infrastructure, not the one that requires the least setup.

FAQs

No. With OpenNext adapters for AWS and Cloudflare, features like ISR, on-demand revalidation, and streaming SSR are supported in production. The Deployment Adapter API in Next.js 16.2 helps ensure adapters maintain compatibility through a shared test suite, so feature parity is far closer than it used to be.

Choose Docker or next start when your team already runs containerized workloads on platforms like ECS, Cloud Run, or Fly.io and you want full control over the runtime. OpenNext makes more sense when you want serverless scaling on AWS Lambda or edge delivery via Cloudflare Workers without managing infrastructure yourself.

The AWS adapter, maintained by the SST community, has been used in production since 2023, and the Cloudflare adapter is actively maintained by the Cloudflare team. Since Next.js 16.2, both build on the official Deployment Adapter API, which provides a stable contract instead of relying on reverse-engineered build output.

Use next dev for daily development since it offers fast hot reloads. The Cloudflare build transformation takes longer and is intended for preview or deployment, not active iteration. The recommended flow is develop with next dev, then use the adapter tooling to build and preview before deploying.

Gain Debugging Superpowers

Unleash the power of session replay to reproduce bugs, track slowdowns and uncover frustrations in your app. Get complete visibility into your frontend with OpenReplay — the most advanced open-source session replay tool for developers. Check our GitHub repo and join the thousands of developers in our community.

OpenReplay