How to Set Up a Node.js Application in cPanel with CloudLinux
Running a Node.js application does not have to mean manually configuring services, reverse proxies or server-level tools.
On 040Hosting servers with CloudLinux and cPanel, Node.js applications can be managed through the Node.js Selector. This makes it possible to choose a Node.js version, configure the application path, install dependencies and restart the application directly from cPanel.
This guide explains how to set up a Node.js application using the CloudLinux Node.js Selector in cPanel.
Before You Start
You need the following:
- A cPanel account with Node.js Selector enabled
- Your Node.js application files
- A valid
package.jsonfile - SSH or Terminal access, if your application requires command-line actions
If Node.js Selector is not visible in your cPanel account, contact our support department so we can check whether it is available for your hosting package.
Step 1: Log in to cPanel
Log in to your cPanel account.
You can usually access cPanel using:
Replace yourdomain.com with your own domain name.
Step 2: Open the Node.js Selector
Inside cPanel, look for:
You can usually find this under the Software section. You can also use the cPanel search bar and search for Node.js.
Step 3: Create a New Node.js Application
Click Create Application.
You will now need to configure the basic application settings.
Node.js Version
Select the Node.js version required by your application.
In most cases, you should use the latest stable version supported by your application. Do not simply choose the newest version if your application has specific version requirements.
Application Mode
Choose the application mode:
Use Production for live websites and applications.
Use Development only while testing or debugging.
Application Root
This is the directory where your Node.js application files will be stored.
Example:
This directory is relative to your cPanel account, not necessarily your website document root.
Application URL
This is the URL where your application will be available.
Example:
You can also run the application directly on a subdomain, depending on how your hosting account is configured.
Application Startup File
Enter the file that starts your application.
Common examples are:
server.js
index.js
This must match the actual startup file used by your application.
Once everything is filled in, click Create.
cPanel will now create the Node.js environment for your application.
Step 4: Upload Your Application Files
Upload your application files to the Application Root directory you selected earlier.
You can do this using:
- cPanel File Manager
- SFTP
- SSH
- Git, if your workflow uses it
Make sure your application directory contains a valid:
This file tells Node.js which dependencies your application needs.
Step 5: Install the NPM Dependencies
Go back to Setup Node.js App in cPanel.
Find your application and click Manage.
From there, run:
This installs the dependencies listed in your package.json file.
If your application needs additional build steps, you may need to run those through Terminal or SSH, depending on how the application is built.
Step 6: Start the Application
After the dependencies have been installed, start the application from the Node.js Selector interface.
Use the available option to run or start the application using the configured startup file.
If everything is configured correctly, cPanel should show that the application is running.
Step 7: Test the Application
Open the URL you configured earlier.
Example:
If the application has been set up correctly, your Node.js application should now be live.
Managing Your Node.js Application
After the application is running, you can manage it from the same Setup Node.js App interface in cPanel.
Restarting the Application
If you update your application code, install new packages or change configuration files, you may need to restart the application.
Use the Restart option in the Node.js Selector.
Viewing Logs
If something does not work, check the application logs.
Logs are useful for finding errors such as:
- Missing dependencies
- Incorrect startup file
- Wrong Node.js version
- Application crashes
- Invalid configuration
Changing the Node.js Version
You can change the Node.js version from the application management screen.
Before doing this, make sure your application supports the version you want to use. Some older applications may not work correctly on newer Node.js versions.
Important Notes
Node.js Selector makes application deployment easier, but the application itself still needs to be correctly built and configured.
Always check:
- The startup file is correct
package.jsonexists- Required dependencies are listed properly
- The selected Node.js version matches your application
- The application URL points to the correct location
- Production mode is used for live applications
Conclusion
CloudLinux Node.js Selector in cPanel makes it much easier to run Node.js applications on shared or managed hosting environments.
Instead of manually configuring Node.js at server level, you can choose the Node.js version, define the application path, install dependencies and restart the application directly from cPanel.
This keeps the setup clean, manageable and suitable for hosting environments where stability and separation between accounts are important.