Deployment

A Next.js 10,514 build is not a folder of files you copy to a web root. It is a mixture: prerendered HTML for the routes that could be resolved at build time, a server bundle for the routes that cannot, hashed static assets, and manifests that tell a server which is which. Deployment means giving that mixture a Node.js 2,131 process to live in, and putting something sensible in front of it.

Performance in Production covers what a production Node.js process needs in general and Performance and Deploy covers shipping the Express 24,430 API of Express.js; neither is repeated here. What follows is specific to the framework: build output modes, the standalone server, which environment variables are frozen into the bundle and which are read on every request, where the ISR cache lives when nobody runs it for you, and what a proxy must be told so that streaming still streams. The target architecture is the one this book has been building toward.

Where the Next.js process sits in a self-hosted MERN deployment
Where the Next.js process sits in a self-hosted MERN deployment

Everything below was produced with Next.js 16.3.5 on Node.js 25.8.0, in a four-route app: a static home page, a /prices page with a revalidation window, a /status page that reads an environment variable at request time, and an /api/health route handler.

Subsections