Skip to main content
Next.js can be deployed as a Node.js server, Docker container, static export, or adapted to run on different platforms.
Deployment optionFeature support
Node.js serverAll features
Docker containerAll features
Static exportLimited (no server-required features)
AdaptersPlatform-specific

Node.js server

Next.js can be deployed to any hosting provider that supports Node.js. Ensure your package.json has the build and start scripts:
{
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start"
  }
}
Then run npm run build to build your application and npm run start to start the Node.js server. This server supports all Next.js features. Node.js deployments support the full Next.js feature set. See the self-hosting guide for infrastructure configuration details.

Deployment templates

Docker

Next.js can be deployed to any provider that supports Docker containers, including Kubernetes and cloud providers that run Docker. Docker deployments support the full Next.js feature set. See the self-hosting guide for infrastructure configuration details.
For development on Mac and Windows, use local development (npm run dev) rather than Docker for better performance. See the local development guide.

Dockerfile templates

The following examples demonstrate best practices for containerizing Next.js applications:
  • Docker Standalone Output — Uses output: "standalone" to generate a minimal, production-ready Docker image with only the required runtime files and dependencies.
  • Docker Export Output — Uses output: "export" to generate optimized HTML files served from a lightweight container or static hosting environment.
  • Docker Multi-Environment — Manages separate Docker configurations for development, staging, and production environments.
Hosting providers with Next.js deployment guides:

Static export

Next.js can be used as a static site or Single-Page Application (SPA), then optionally upgraded later to use server features. A static export can be deployed to any web server that serves HTML/CSS/JS static assets, including AWS S3, Nginx, and Apache.
Running as a static export does not support Next.js features that require a server, such as dynamic routes with getServerSideProps, API routes, Image Optimization (default loader), and middleware. See static exports for the full list of unsupported features.
To enable static export, update next.config.js:
next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
  output: 'export',
}

module.exports = nextConfig
After running next build, Next.js generates an out folder with HTML/CSS/JS assets.

Deployment templates

Adapters

Next.js can be adapted to run on platforms with their own infrastructure capabilities. Refer to each provider’s documentation for supported Next.js features:
PlatformDocumentation
Appwrite Sitesdocs
AWS Amplify Hostingdocs
Cloudflaredocs
Deno Deploydocs
Firebase App Hostingdocs
Netlifydocs
Verceldocs
A Deployment Adapters API is in development to standardize how all platforms adopt Next.js. Documentation on writing custom adapters will be added after completion.

Build docs developers (and LLMs) love