Skip to main content

How to Deploy a Node.js Application in cPanel

You can deploy and run a Node.js application directly within cPanel using the Application Manager. This process allows you to manage the application's environment, start the process, and monitor its status.

You can deploy and run a Node.js application directly within cPanel using the Application Manager. This process allows you to manage the application's environment, start the process, and monitor its status.

Important: This feature is only available on specific Hostek plans that support Node.js applications.

Before you begin

You will need:

  • An active Hostek account with cPanel access.

  • A prepared Node.js application (including your source code and a package.json file).

  • The specific path to your application's root directory.

Deploying the application

  1. Log in to your cPanel account.

  2. Locate the Software section and select Application Manager.

  3. Click Add Application (or the equivalent button to create a new entry).

  4. Enter a Name for your application.

  5. Select the Application_type (e.g., Node.js).

  6. Provide the Application_root (the path to your files) and the Application_URL (the domain or subdomain where the app will be accessible).

  7. Enter the Startup file (typically app.js or index.js).

  8. Click Save or Create.

Configuring and starting the application

Once the application is registered in the Application Manager, you must configure the environment and start the process.

  1. In the Application Manager, find your application in the list.

  2. Click Edit or Manage next to the application.

  3. Under the Environment Variables section, add any necessary keys and values (such as PORT or NODE_ENV).

  4. Click Save to apply the environment changes.

  5. Click Start or Restart to initiate the Node.js process.

Confirm the result

  • The application status in the Application Manager should change to Running or Started.

  • Navigate to the Application_URL you defined in the setup to verify that your website is loading correctly.

Limitations

  • This procedure does not include instructions for installing global npm packages or managing complex build pipelines; these should be completed before adding the application to the Manager.

  • If the application fails to start, check the internal logs provided within the Application Manager to identify specific Node.js errors.

Did this answer your question?