
Before you begin
- A Node.js project on your machine with a
package.jsonand an entry file (commonlyapp.jsorserver.js). - cPanel access on a plan that exposes Setup Node.js App.
- A domain or subdomain already pointed at the account.
Deploy Express
Deploy Next.js
Create the container
Open Setup Node.js App


cPanel home → Software → Setup Node.js App
Click + Create Application


Application list with the Create Application button
Fill in the form
- Node.js version: pick the highest LTS your code supports. Most projects want 22 or 20.
- Application mode:
Production. Switch to Development only while chasing a boot error. - Application root: a folder under your home directory, e.g.
myapp. Created for you if it doesn’t exist. - Application URL: the domain dropdown plus an optional path. Use
/for the root or/apito mount the app on a sub-path. - Application startup file: defaults to
app.js. Set this to the file that exports your handler. - Passenger log file: optional, but worth setting (e.g.
logs/passenger.log). It’s where boot errors land.


Create Application form filled in for a sample app
Click Create
Upload your code
Three workflows. Pick whichever fits how your project lives today.- File Manager
- SFTP
- Git
node_modules and .git), then:- cPanel home → File Manager.
- Navigate to the application root you created (e.g.
~/myapp). - Upload the zip, then right-click it and Extract in place.
- Delete the zip once the contents are extracted.
Install dependencies
Back on Setup Node.js App, find your app in the list and open it. Click Run NPM Install. cPanel sources the per-app virtualenv, then runsnpm install against the package.json in your application root.
Big dependency trees (Next.js, Nuxt, Strapi, anything that pulls in sharp) can OOM during install. Run it over SSH instead, with flags that keep the resident set smaller:
node_modules on a dev machine and rsync the tree up.
Set environment variables
The Environment variables editor sits below the buttons on the management page. Add entries one at a time. Variable names take letters, numbers, underscores, and dashes (max 256 characters). Values are ASCII, max 1024 characters. Common ones to set:PORT. Passenger ignores it. It drives the runtime over a Unix socket, not a TCP port. If your code reads process.env.PORT, that’s fine, but the value is irrelevant.Make the entry file Passenger-compatible
Passenger runs your code. Your code does not start an HTTP server. Export anhttp.Server or an Express app, do not call .listen().
listen() call, edit the file in place (File Manager → right-click → Edit, or via SSH) before the next restart.
Start and verify
Restart from the management page
touch ~/myapp/tmp/restart.txt from SSH.Hit the URL
If it's a 503, check the log
Common issues
503 on every request
503 on every request
app.listen(PORT) in the startup file. Swap to module.exports = app, then Restart.Cannot find module 'X' after deploying
Cannot find module 'X' after deploying
package.json is in the right place, but node_modules was built on a different machine or Node version. Click Run NPM Install so it builds against the per-app env.Boot times out after 60 seconds
Boot times out after 60 seconds
~/myapp/.htaccess and add above the Selector-managed block:App URL returns the cPanel default page, not your app
App URL returns the cPanel default page, not your app
/api) but you’re hitting /. Either change the URL in the form, or move your routes so they match the configured path.`npm install` runs out of memory
`npm install` runs out of memory
--prefer-offline --no-audit, or build node_modules locally and rsync the directory up.Env var change doesn't take effect
Env var change doesn't take effect

