How to create a Node.js app in cPanel Print

  • 0

  1. In cPanel, open Setup Node.js App in the Software section.
  2. Click Create Application.
  3. Choose the Node.js version (a current LTS version is recommended).
  4. Set Application mode to Production.
  5. Enter the Application root, the folder holding your app (for example myapp), kept outside public_html.
  6. Choose the Application URL, the domain or path the app runs on.
  7. Enter the Application startup file, for example app.js.
  8. Click Create.

Install dependencies

Upload your app files and package.json to the application root, then click Run NPM Install. Alternatively, copy the command shown at the top of the page to enter the app's environment over SSH and run npm there.

Restarting

Click Restart after changing code. Your app must listen on the port provided by the environment (process.env.PORT), not a fixed port.

Node.js apps on shared hosting are subject to the account's resource limits; very busy or long-running apps may need a VPS.


Was this answer helpful?

« Back