Introduction

The Setup Node.js App feature in cPanel allows you to run server-side JavaScript applications built with Node.js directly on your hosting account. This tool provides an easy graphical interface to configure, manage, and deploy Node.js environments without needing SSH or command-line access.

This article walks you through setting up a Node.js app in cPanel, including environment creation, project configuration, and startup.


What Is Node.js?

Node.js is a server-side runtime environment based on the V8 JavaScript engine, ideal for building scalable, real-time applications like:

  • APIs

  • Chat apps

  • Dashboards

  • Data processing tools

Running Node.js in cPanel lets you integrate modern web functionality alongside PHP apps like WordPress.


Prerequisites

  • A hosting account that supports Node.js (usually on Cloud, VPS, or specialized shared hosting plans)

  • A domain or subdomain to run the app

  • Your app files uploaded to a directory in your home folder


How to Access the Setup Node.js App Tool

  1. Log in to your cPanel account

  2. Scroll down to the Software section

  3. Click on Setup Node.js App

You’ll be redirected to the application manager interface.


Creating a New Node.js Application

  1. Click the “Create Application” button

  2. Fill out the application settings:

    • Node.js version – Choose from the list (e.g., 14.x, 16.x)

    • Application mode – Choose Production or Development

    • Application root – The folder where your app files are located (e.g., myapp)

    • Application URL – Select domain or subdomain

    • Application startup file – Typically app.js or server.js

  3. Click Create to initialize the environment

Your Node.js environment will now be created, and cPanel will set up the backend infrastructure.


Managing Your Node.js App

After creation, you’ll be able to:

  • Start, Stop, or Restart your app

  • Edit environment variables

  • Change the Node.js version

  • View your app’s log files for debugging

You can also run commands via the Terminal option (if available) or from SSH, using the app's virtual environment path.


Installing npm Packages

To install required npm modules:

  1. Scroll to the Application root

  2. Upload your package.json file (or manually create it)

  3. Use SSH or the cPanel Terminal to run:

bash
CopyEdit
cd ~/myapp npm install

This will install dependencies like express, cors, or any others defined in your project.

Some hosting providers allow this step from the cPanel interface itself by clicking Run NPM Install.


Updating Your Node.js App

  • Modify your source code as needed in the application root directory

  • After changes, restart the app from the cPanel interface for updates to take effect

  • Check logs for errors or success messages


Troubleshooting

Issue Solution
App won’t start Check startup file path and console logs
500 Internal Server Error Ensure correct port and no conflicts
Cannot access app URL Make sure the domain/subdomain is properly routed
npm install fails Check file permissions and hosting limits

Conclusion

The Setup Node.js App feature in cPanel makes it easy to run powerful JavaScript-based server applications without deep command-line knowledge. Whether you're launching a simple API or a real-time dashboard, cPanel provides the tools to get your Node.js project online with minimal configuration and maximum flexibility.

Was this answer helpful? 0 Users Found This Useful (0 Votes)