How to setup my NodeJs App Print

  • nodejs, javascript, hosting
  • 20

Follow these steps to successfully deploy and run your Node.js application on cPanel shared hosting.

Part 1: Create the Node.js Application in cPanel

  1. Make sure Jailed SSH access is enabled on your account (contact support if needed).
  2. Upload your complete Node.js project files via File Manager or FTP into a subfolder inside public_html (e.g., /home/yourusername/public_html/myapp).
    Important: Files are not allowed directly in the public_html root.
  3. In cPanel, go to Setup Node.js App → Click Create Application.
  4. Choose the Node.js version that matches your project.
  5. Select Application mode: Development (for testing) or Production (recommended for live sites).
  6. Set Application root to your project folder (e.g., /home/yourusername/public_html/myapp).
  7. Set Application URL – this is the domain or subdomain where your app will be accessible.
  8. Enter the full path to your startup file (usually app.js or server.js), for example:
    /home/yourusername/public_html/myapp/app.js
  9. Specify a Passenger log path (e.g., /home/yourusername/logs/passenger.log).
  10. Click Create.

 

646_Node2.png

Part 2: Install Dependencies & Configure the App

Option A – Using cPanel (Easiest)

  1. After creation, you’ll see the new app listed. Click NPM Install button – cPanel will automatically install everything from package.json.

 

 

2. Edit your configuration files (settings.json, .env, config.js, etc.) with correct database details, site URL, SMTP, etc.

3. Click Restart Application.

 

 

Option B – Using Terminal / SSH (More Control)

  1. Open Terminal in cPanel or connect via SSH.
  2. Copy and run the virtual environment activation command shown in your app details, e.g.:
    source /home/yourusername/nodevenv/public_html/myapp/18/bin/activate && cd /home/yourusername/public_html/myapp

 

ee8qNXaWAFtApM91vPhDMHHrViQ7kbtAl4nHcRpATYKYtYX3R_NS_AW4bW_A4fuvHbcQcnVcCUqAaagXSZpQsIgqd7UH_Q1R2VvCcjcmftuKJGACqwFaokgXxAtJpaxHCd9x0IU8

3. Inside the virtual environment, run:
npm install

4. Update your config files (database, URL, email settings, etc.).

5. Back in cPanel, restart the application.

Your Node.js app is now live and running!




Was this answer helpful?

« Back