Next.js supports several deployment targets, controlled partly by the output config. The right choice depends on whether you need the Node server, containers, or pure static hosting.
The build output modes
. = {
};
Next.js supports several deployment targets, controlled partly by the output config. The right choice depends on whether you need the Node server, containers, or pure static hosting.
. = {
};
Runs a Node.js server, so you get everything: SSR, ISR, Server Actions, Route Handlers, image optimization, middleware. This is what platforms like Vercel (the maker of Next.js, zero-config) and Node hosts use.
# Next traces only the needed files into .next/standalone → a tiny, self-contained server
COPY --from=builder /app/.next/standalone ./
CMD ["node", "server.js"]
standalone produces a minimal folder with only the dependencies actually used, ideal for small Docker images on AWS, GCP, your own servers, etc. You keep all server features.
next build → out/ (plain HTML/CSS/JS, deployable to any static host: S3, GitHub Pages, Netlify CDN)
Static export gives the cheapest, simplest hosting but disables server features: no SSR, no ISR, no Route Handlers, no Server Actions, no on-the-fly image optimization. Only suitable for fully static sites.
Need SSR/ISR/Server Actions, want zero-config → Vercel (or a Node host) — default output
Want containers / self-host with full features → output: "standalone" + Docker
Purely static content (docs, marketing) → output: "export" → any static CDN
- Runtime choice (Edge vs Node) affects where functions run
- Self-hosting ISR/caching needs persistent storage or a shared cache
- Image optimization on non-Vercel hosts may need a custom loader
Deployment isn't one-size-fits-all: the output mode determines which Next.js features survive.
Knowing that the default/Node output keeps all server capabilities, standalone packages them for Docker/self-hosting, and export trades all server features for pure static hosting lets you match the build to your infrastructure — and avoid the trap of output: "export" silently breaking SSR/ISR/Server Actions.