server.js
The small generated Node.js server file in the standalone output that serves the whole app.
In more detail
Start it with node server.js; it reads PORT and HOSTNAME environment variables. It replaces next start, so the container does not need the Next.js CLI.
Related terms
- standalone output — A next.config setting that makes next build produce a self-contained folder with a minimal server.js and only the node_modules files it needs.
- next start — The Next.js command that runs a production server from the output of next build.
Taught in
- Containerized Deployment: Multi-Stage Docker Builds — Next.js 15 & Modern App Router Architecture