This guide explains how to set up a Node.js application in cPanel using the Setup Node.js App feature.
Requirements
-
A cPanel account with Node.js Selector enabled.
-
Node.js must be installed on the server (via CloudLinux or server administrator).
-
SSH access (optional but recommended).
If you do not see the Setup Node.js App option in cPanel, contact your hosting provider.
Step 1: Log in to cPanel
-
Access your cPanel account.
-
Scroll to the Software section.
-
Click on Setup Node.js App.
Step 2: Create a New Node.js Application
-
Click Create Application.
-
Configure the following:
-
Node.js Version: Select your preferred version.
-
Application Mode: Choose
Production(recommended) orDevelopment. -
Application Root: Set the folder where your app files will be located (e.g.,
nodeapp). -
Application URL: Select the domain or subdomain.
-
Application Startup File: Enter the main file name (e.g.,
app.jsorserver.js).
-
-
Click Create.
Step 3: Upload Application Files
You can upload your Node.js files using:
-
File Manager (cPanel)
-
FTP
-
Git (if repository deployment is used)
Upload all project files inside the Application Root directory.
Step 4: Install NPM Dependencies
After the application is created:
-
Go back to Setup Node.js App.
-
Click on your created application.
-
Click Run NPM Install.
This will install all dependencies listed in your package.json file.
Step 5: Restart the Application
-
Click Restart from the application management page.
-
Wait for the process to complete.
-
Visit your application URL to verify it is working.
Optional: Connect via SSH (Advanced)
If SSH access is enabled:
-
Connect using SSH.
-
Navigate to the application root:
-
Activate the environment (copy the command shown in cPanel under “Enter to virtual environment”).
-
Run manual commands if needed:
Troubleshooting
-
Ensure the startup file name matches your main application file.
-
Confirm
package.jsonexists in the application root. -
Check application logs from cPanel if the app fails to start.
-
Make sure the selected Node.js version matches your project requirement.