How to publish a Node.js application in cPanel

If your cPanel has the new design and you do not see Setup Node.js App, click Classic cPanel theme (top right): it is in the Software section.

With Setup Node.js App you publish a Node.js application (Express, Next.js, NestJS or your own backend) on your domain and choose the version it runs: 26, 24 or 22, and older ones if your code needs them.

Before starting: your plan must include applications. Most Cloud Web Hosting plans allow up to four. If you do not see Setup Node.js App in cPanel, write to us.

1. Create the application

  1. In cPanel → Software, open Setup Node.js App and click Create Application.
  2. Node.js version: the one your project needs; for a new one, 24 or 26.
  3. Application mode: Production for the live site, Development while testing.
  4. Application root: the folder in your account for the code, e.g. myapp. Not public_html.
  5. Application URL: the domain or subdomain, and a path if the app is not at the root.
  6. Application startup file: the file that starts your app, e.g. app.js or server.js.
  7. Click Create.

2. Upload your code and install dependencies

  1. Upload the code to that folder with File Manager, FTP or Git Version Control. The package.json must be there.
  2. Back in Setup Node.js App, edit the application and click Run NPM Install.
  3. Under Environment variables, add what your app reads from process.env (API keys, database connection string, etc.).
  4. Click Restart.

Your app must listen on the port the environment gives it: app.listen(process.env.PORT || 3000). The web server routes your domain's visits to it.

3. Over SSH (optional)

If your plan has SSH or Terminal, the top of the application screen shows a command starting with source. Paste it in the terminal to enter your app's environment with its Node.js and npm versions, and run npm install, npm run build or whatever you need.

Changing version

Edit the application, choose another Node.js version, save, run Run NPM Install again and restart. If something fails, switch back the same way.

If it does not load

  • 503 or the app does not start: check the startup file exists and has no errors; the application log says what failed. See Errors 500, 502, 503, 504 and 508.
  • You changed the code and nothing changes: click Restart. The app does not reload by itself.
  • Missing modules: run Run NPM Install again with the version you are using.


Was this article helpful?

mood_bad Dislike 0
mood Like 0
visibility Views: 129