How to set up a Node.js application in Spaceship Web Hosting

The Setup Node.js App tool in Spaceship Web Hosting allows you to deploy and manage Node.js applications directly from your control panel. The feature is powered by CloudLinux and runs applications using Passenger.

This guide explains how the interface works, how to create an application, and how to manage it.


Overview
  1. After logging in to your cPanel, open Setup Node.js App under the Exclusive section:


  2. At the top of the page, you will see the Create Application button. Below it, any existing Node.js applications will be listed. Each application entry displays its configuration details and management options:

For each created application, the interface allows you to view its general details, including the application URL (URI), root directory, mode (development or production), and current status

From the same page, you can restart or stop the application, edit its configuration and environment variables, or remove it entirely.

Tip: The applications table can be sorted by clicking on the column headers, such as App URI, Root Directory, Mode, or Status. This makes it easier to manage multiple applications within the same account.


How to create an application


After hitting the +Create Application button, you’ll need to configure your app by entering the following parameters:

  • Node.js version
    Select the version required by your application. Always ensure compatibility with your package.json file.

  • Application mode
    Choose between Development and Production. For live websites, Production mode is recommended.

  • Application root
    Specify the directory where the application files will be stored. This will create the corresponding folder under /home/username.

  • Application URL
    Select the domain or subdomain where the application will be accessible.

  • Application startup file
    Enter the main file that starts your application (e.g., app.js or server.js)

Once all settings are entered, click Create. The success message will pop up, after which the system will initialize the environment and display your application details.


Managing the application


Once deployed, your application can be managed from the same interface. Here, you can:

  • Edit your application


The editing page opens:

  • Restart

  • Stop/start

  • Delete


Note: Removing the application deletes the configuration but does not automatically remove your project files unless you do so manually.


Uploading files and installing dependencies


After the application is created, upload your project files (including package.json) into the specified application root directory.

Then, you can install dependencies in two ways:

  • Inside the Setup Node.js App >> Run NPM Install:


    The system will read your package.json file and install all required modules.

  • Via SSH >> virtual environment.


    To enter the virtual environment via SSH, run the highlighted command mentioned at the top of the page:


    Next, run the command npm install. This achieves the same result but gives you flexibility to:

    • Install specific packages (npm install package-name)

    • Install other modules/development dependencies

    • Run build scripts (npm run build)

    • Troubleshoot npm errors directly.


Setting environment variables


Environment variables can be configured inside the application settings. You can define variables such as NODE_ENV, API keys, database credentials, etc.


Save the changes and restart the application afterwards.

A valid email is required