How to Setup Node.js Application in cPanel


This article provides a guide for how to setup Node.js application in cPanel shared hosting account.

Setting up a Node.js application in cPanel involves several steps, including creating the application, configuring the environment, and managing the app's processes. Here’s a step-by-step guide:

1. Log in to cPanel

Log in to your cPanel account using your credentials.

2. Access the Setup Node.js App

  1. In cPanel, scroll down to the Software section.
  2. Click on Setup Node.js App.
    Navigate to Setup Node.js App

3. Create a New Application

  1. Create Application:

    • Click on Create Application.
    • Select the Node.js version you want to use from the Node.js Version dropdown.
    • Set the Application Mode to either "Production" or "Development" depending on your needs.
    • Specify the Application Root (the directory where your application’s files will be stored).
    • Set the Application URL (the URL at which your application will be accessible).
    • Define the Application Startup File (usually app.js or server.js).
  2. Create the Application:

    • Click Create.

4. Deploy Your Application Files

  1. You can upload your application files to the directory specified in the Application Root using the File Manager or FTP.

  2. Ensure that your application’s dependencies are installed:

    • Access the terminal via cPanel’s Terminal feature.
    • Navigate to your application’s directory: cd path/to/application/root.
    • Run npm install to install all required dependencies listed in your package.json file.

5. Run the Application

  1. Go back to Setup Node.js App.
  2. Click on the Run NPM Install button to install dependencies.
  3. Click Restart to start the Node.js application.

6. Check the Application Status

You can monitor your application's status and logs from the Setup Node.js App interface. If the application doesn’t start, check the logs for any errors and troubleshoot accordingly.

7. Manage Application

  • Environment Variables: You can set environment variables in the Setup Node.js App interface if needed.
  • Restart or Stop: You can stop or restart your application from the same interface.

8. Access Your Application

Once everything is set up, you can access your application via the URL you specified.

Additional Tips:

  • Security Considerations: Make sure your application is secured, especially if it’s a production environment.
  • Monitoring: Set up monitoring for your Node.js application to track its performance and uptime.

This process should get your Node.js application up and running in a cPanel environment.

  • nodejs, npm, cpanel features
  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

Video: Create Email Address in cPanel

This video tutorial demonstrates how to create an email address using cPanel Shared Hosting...

Disabling mod_security in cPanel

Mod_security is an apache module that helps to protect your website from various attacks. It is...

Video: Setup Email Forwarder in cPanel

View our Step-by-Step Tutorial Video for Setting up an Email Forwarder in cPanel Shared Hosting.

Install an SSL Certificate Using the AutoInstaller Software in cPanel

This article will describe how to use AutoInstall to install an SSL certificate.The AutoInstall...

Video: Add MX Entry in cPanel

This video tutorial provides Step-by-Step instructions for adding an MX entry in cPanel Hosting...