Updated: August 9, 2026

By Matic BončinaFounder
Review pending
http handler.
For the underlying tool, see Node.js.
Before you begin
- A Node.js app already created in cPanel, version 22 or 24. Node 20 is EOL and shouldn’t be used for a new deploy.
- The app root contains your Next project (
package.json,pages/orapp/,next.config.js). - SSH access (recommended for builds).
Build for production
A Next build is memory-hungry and can OOM when run from the cPanel UI, even on plans with several GB. Build over SSH:next is in dependencies, not devDependencies.
Add a Passenger-compatible server
1
Create server.js in the app root
server.js
2
Set the startup file
In cPanel, open Setup Node.js App, click your app to open its management page, set Application startup file to
server.js, then click Save.3
Restart
Click Restart, or
touch ~/myapp/tmp/restart.txt.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.

