
Next.js can come out in two very different ways, and picking the wrong one lies behind almost every deployment problem. The short answer: if your site does not need code running on the server for every visit, make a static export and publish it as plain files, which fits any hosting plan. If it does (pages rendered on the server, API routes, middleware), you need an always-on Node process: it fits “Setup Node.js App” when it is simple, and sits better on a VPS.
The possible outputs
| Mode | What it produces | Where it runs | What you give up |
| Static export | A folder of HTML, CSS and JavaScript files (called out by default). |
On any hosting plan, like an ordinary site, in the domain’s public folder. | API routes, server-side rendering and middleware. According to the Next.js documentation, next/image images need unoptimized: true. |
Node server (next start) |
A Node process that answers every request. | In cPanel’s “Setup Node.js App”, or on a VPS with PM2 and nginx. | It uses memory all the time and is subject to the account limits. |
standalone mode |
A .next/standalone folder with a server.js and only what is needed. |
Like the Node server; it is the lightest thing to copy to a VPS or into a Docker image. | You must copy the public and .next/static folders by hand, according to the documentation. |
Static export, step by step
|
|
|
|
A Node server in cPanel
|
|
|
|
| Not everything fits a shared account. A Next.js server is a process that stays in memory. If it falls over or slows down for no obvious reason, see the causes of the 503 error. For background jobs, long connections or heavy traffic, the right place is a VPS: keeping the app running with PM2. |
| When in doubt, start with the static export. It is the cheapest to maintain, the fastest to serve and leaves nothing running that could break. Move to a Node server only when a page really needs server data on every request. |
|
Does your application need a process of its own and more room? Have a look at our VPS plans. See the VPS servers |
|
SEE ALSO Publishing a React or Vue site: the build folder and the 404 on refresh |
RECOMMENDED PRODUCT Web hosting with cPanel Domain and SSL included, daily backups and the panel you already know. from 5.940,00 Kz/mo (3-year plan, with coupon) See plans |
- 0 Users Found This Useful











