Next.js supports multiple deployment strategies:
| Deployment Method | Feature Support |
|---|---|
| Node.js server | Full |
| Docker container | Full |
| Static export | Limited |
| Adapters | Platform-specific |
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
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
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.
Next.js can be adapted to run on specific platforms. Refer to each provider’s documentation for feature support:
A Deployment Adapters API is in development to support custom adapters across platforms.
To upgrade to the latest stable version:
npx @next/codemod@latest upgrade latestOr install manually:
pnpm i next@latest react@latest react-dom@latest eslint-config-next@latestTo upgrade to the canary version:
npm i next@canaryFeatures available in canary:
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.