Deploying a Node.js server
Next.js can run almost anywhere, but the deployment target decides which features you get. The most capable target is a plain Node.js server.
Add build and start scripts to package.json:
{
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
}
}
Then npm run build compiles the application and npm run start boots a server
that supports every Next.js feature — Server Components, Server Actions, ISR,
Cache Components, Proxy, and streaming.
Many managed platforms run exactly this server for you. You can also package it as a Docker image and run it on any container host, which supports all the same features.
For containers, Next.js offers a standalone output mode:
// next.config.js
module.exports = { output: 'standalone' };
next build then emits a minimal server.js and only the dependencies it
actually needs, so the image stays small.
A static export, by contrast, produces files with no server at all, so it gives up the server-only features. Choose the target by the features you need, not by habit.
You are about to answer a short quiz on deployment targets.