Deploying Next.js – Node.js Server, Docker Container, Static Export, and Platform Adapters

Next.js can be deployed as a Node.js server, Docker container, static export, or adapted to platform-specific infrastructure. This article explains each deployment method, feature support, development tips, and how to upgrade to the latest or canary versions of Next.js..

Next.js deploymentNode.js serverDocker containerVersion upgrade

~2 min read • Updated Oct 25, 2025

Deployment Options in Next.js


Next.js supports multiple deployment strategies:

Deployment MethodFeature Support
Node.js serverFull
Docker containerFull
Static exportLimited
AdaptersPlatform-specific

Deploying as a Node.js Server


To deploy on any Node.js-compatible provider, ensure your package.json includes:

{
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start"
  }
}

Run npm run build to build and npm run start to launch the server. This method supports all Next.js features.


Recommended platforms: Flightcontrol, Railway, Replit


Deploying with Docker


Next.js can run in any Docker-compatible environment, including Kubernetes or cloud providers.


Note for development: On Mac and Windows, use npm run dev for better performance during development.


Recommended platforms: Docker, DigitalOcean, Fly.io, Google Cloud Run, Render, SST


Deploying as a Static Export


Next.js can be exported as a static site or SPA and hosted on any server that serves HTML/CSS/JS files.


Recommended platforms: AWS S3, Nginx, Apache, GitHub Pages


Limitation: Server-dependent features are not supported in this mode.


Deploying with Platform Adapters


Next.js can be adapted to run on specific platforms. Refer to each provider’s documentation for feature support:

  • AWS Amplify Hosting
  • Cloudflare
  • Deno Deploy
  • Netlify
  • Vercel

A Deployment Adapters API is in development to support custom adapters across platforms.


Upgrading Next.js


Latest Stable Version


To upgrade to the latest stable version:

npx @next/codemod@latest upgrade latest

Or install manually:

pnpm i next@latest react@latest react-dom@latest eslint-config-next@latest

Canary Version


To upgrade to the canary version:

npm i next@canary

Features available in canary:

  • Caching: "use cache", cacheLife, cacheTag, cacheComponents
  • Authentication: forbidden, unauthorized, forbidden.js, unauthorized.js, authInterrupts

Conclusion


Next.js offers flexible deployment options. Whether you choose Node.js, Docker, static export, or platform adapters, you can tailor deployment to your infrastructure and keep your project up-to-date with the latest features.


Written & researched by Dr. Shahin Siami