Run Node.js apps on cPanel via the Node.js Selector. Pick a version, set up the application root, manage with NPM Install and Run JS Script.
The cPanel Setup Node.js App tool registers a Node app under your account, builds an isolated node_modules directory, and hands the running process to Phusion Passenger.Each app picks its own Node version. You can run several apps under the same account on different paths or versions.
The management page opens after creation and is reachable from the app list.
Button
What it does
Run NPM Install
Reads package.json and installs dependencies into the per-app node_modules.
Run JS Script
Runs a package.json script (e.g. build, prestart) under the activated Node env.
Stop App
Halts Passenger for this app. The URL returns 503.
Restart
Equivalent to touch tmp/restart.txt. Reloads the running app.
Edit
Reopens the form. Saving overwrites the .htaccess.
Destroy
Removes Passenger registration and the per-app node_modules directory.
The Environment variables editor sits below the buttons. Names allow letters, numbers, underscores, and dashes (max 256 chars). Values are ASCII, max 1024 chars.
A working example never calls app.listen(). If you copied a tutorial that does, delete that line.
Calling app.listen(PORT) from inside a Passenger-managed app produces a 503 on every request and an EADDRINUSE or Cannot find module line in the Passenger log. Remove the call.
Most often: app.listen(PORT) is in the startup file. Remove it, swap to module.exports = app, then touch tmp/restart.txt to reload.
Cannot find module 'X' after deploying
package.json is in the application root, but node_modules was built on a different machine or against a different Node version. Click Run NPM Install so it installs against the per-app env.
Boot times out after 60 seconds
Default Passenger startup timeout. Add to .htaccess above the Selector-managed block:
PassengerStartTimeout 120
Common cause: the app loads a large dataset on boot, or a synchronous DNS lookup blocks startup.
WebSockets close after a few seconds
Passenger forwards Upgrade: headers, but the LVE entry-process cap throttles long-lived connections. Plan around 20 to 30 simultaneous WS clients on a shared plan, or move to a Power plan.
`npm install` runs out of memory
PMEM is ~1 GB. Large dependency trees (Next.js, Strapi) can OOM during install. Run install over SSH with --prefer-offline --no-audit, or build on a dev machine and rsync node_modules and code over.