View Categories

How to Deploy a Nodejs App

Log in to your Control Panel:

Navigate to Setup Node.js App:

  • Locate the “Extra Features” section and click on “Setup Node.js App.” 

Create a New Application:

  • On the Node.js application manager page, click “Create Application.” 

Configure Application Settings:

  • Node.js Version: Select the desired Node.js version for your application from the dropdown menu.
  • Application Mode: Set the NODE_ENV variable to either Development or Production based on your needs.
  • Application Root Directory: Specify the directory where your Node.js application’s files and folders are located. You can choose an existing directory or create a new one. 

Application URL: Enter the web address where your application will be accessible. This can be your main domain or a subdirectory. 

  • Application Startup File: Specify the main file that initiates your application (e.g., app.js, server.js).
  • Passenger Log File (Optional): Define a path for your application’s log file if needed.

Save the Application: Click “Save” or “Create” to finalize the application setup.

Upload Application Files: Upload your Node.js application files (excluding node_modules if you intend to install dependencies on the server) to the specified “Application Root Directory” using the File Manager or FTP.

Install Dependencies (if necessary): If you haven’t uploaded node_modules, you may need to install dependencies via SSH by navigating to your application root and running npm install.

Start and Manage the Application: Once configured, the Node.js manager will typically handle starting and stopping your application. You can monitor its status and logs through the control panel.