http handler.
For the underlying tool, see Node.js.
Before you begin
- A Node.js app already created in cPanel, version 20 or 22.
- The app root contains your Next project (
package.json,pages/orapp/,next.config.js). - SSH access (recommended for builds).
Build for production
Builds can OOM under the cPanel UI on a 1 GB plan. Build over SSH:next is in dependencies, not devDependencies.
Add a Passenger-compatible server
Set the startup file
In cPanel, Setup Node.js App → Edit → Application startup file:
server.js. Save.Common issues
`next: command not found` during build
`next: command not found` during build
Move
next from devDependencies into dependencies and re-run npm install.Build OOMs
Build OOMs
Build on a dev machine instead, then rsync
.next/ and public/ up. Skip building on the server entirely.API routes return 404
API routes return 404
The custom server above hands every request to Next. If you wrap routes in custom Express middleware, make sure the catch-all delegates back to
handle(req, res).Need a hand?
Open a ticket
Best for anything that needs an account check or a config change on our end.
Live chat
Faster for quick questions during business hours.

