# How to deploy a Node.js application

> Deploy a Node.js application on Kualo hosting using cPanel's Node.js Selector and Phusion Passenger.

Source: https://www.kualo.com/knowledgebase/dev-languages/how-to-deploy-a-nodejs-application
Updated: 2026-06-09

---

Kualo hosting supports Node.js applications through cPanel's Node.js Selector, which uses Phusion Passenger as the web server. This guide walks you through the setup process using Ghost CMS as a practical example.

:::info
Before you begin, make sure you have enabled Node.js in cPanel. See [Enabling Node.js in cPanel](/knowledgebase/nodejs/enabling-nodejs-in-cpanel) for instructions.
:::

## How it works

The Node.js Selector handles the environment setup for you. Specifically, it:

- Adds the Phusion Passenger configuration lines to your `.htaccess` file
- Installs and configures Node.js inside a virtual environment

## Set up the environment

1. Open the Node.js Selector in cPanel and create a new application. Choose the Node.js version that matches your application's requirements. For Ghost CMS, check the [Ghost Node.js version requirements](https://ghost.org/docs/) before selecting a version.

   ![NodeJS Selector](https://kb-cdn.kualo.com/09/d2/09d2bb49d4f6d67bec65cac1b1cdbb240d600bdf.png)

2. After clicking **Create**, the selector creates the application and displays the command you need to activate the virtual environment.

   ![NodeJS Selector activation command](https://kb-cdn.kualo.com/bc/de/bcded5105f9eb06860447a3551d11b6c84515bf5.png)

3. Set the application mode to **Production**, then click **Save**.

4. Set the startup file name. For Ghost CMS, this is `index.js`.

## Install Ghost CMS

1. Log in to your account via SSH and activate the virtual environment using the command shown in the Node.js Selector. For example:

   ```bash
   source /home/nodejstest/nodevenv/my_apps/ghost/10/bin/activate && cd /home/nodejstest/my_apps/ghost
   ```

   Your prompt will change to confirm the environment is active:

   ```bash
   [my_apps/ghost (10)] nodejs@ ~/my_apps/ghost $
   ```

2. Download and unzip Ghost CMS into the application folder:

   ```bash
   wget https://ghost.org/zip/ghost-latest.zip
   unzip ghost-latest.zip
   ```

3. Remove the default Passenger placeholder files:

   ```bash
   rm -rf public
   rm -f app.js
   ```

4. Install the production dependencies. This reads `package.json` and installs all required modules - similar to `composer.json` for PHP or a `Gemfile` for Ruby:

   ```bash
   npm install --production
   ```

5. Create a MySQL database and database user in cPanel, then edit `./core/server/config/env/config.production.json` with your database credentials:

   ```json
   {
       "database": {
           "client": "mysql",
           "connection": {
               "host"     : "127.0.0.1",
               "user"     : "nodejstest_ghostusr",
               "password" : "my_password",
               "database" : "nodejstest_ghostdb"
           }
       },
       "paths": {
           "contentPath": "content/"
       },
       "logging": {
           "level": "info",
           "rotation": {
               "enabled": true
           },
           "transports": ["file", "stdout"]
       }
   }
   ```

6. Edit `./core/server/config/defaults.json` and update the URL and server host to match your domain:

   ```json
   {
       "url": "http://nodejs.mydomain.com",
       "server": {
           "host": "nodejs.mydomain.com",
           "port": 80
       }
   }
   ```

7. Return to the Node.js Selector in cPanel and click **Restart**.

:::info
After restarting, you may briefly see a 503 error page. This is normal - click **Return to home page** and your application should load correctly.
:::

---

_Source: Kualo Knowledgebase — https://www.kualo.com/knowledgebase/dev-languages/how-to-deploy-a-nodejs-application · © Kualo Ltd._
