> ## Documentation Index
> Fetch the complete documentation index at: https://kb.hostcloud.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Run a Node.js app in cPanel

> Host a Node.js application on your HostCloud hosting with Setup Node.js App.

You can run Node.js applications, such as an Express website or an API, on HostCloud hosting. This guide shows you how to set one up in cPanel.

## Create the application

**1. Open Setup Node.js App**

[Log in to cPanel](/cpanel/log-in-to-cpanel.md), type **Setup Node.js App** in the **Search Tools** box and open it.

**2. Start a new app**

Click **Create Application**.

**3. Fill in the details**

| Field | What to enter |
| - | - |
| Node.js version | The version your app needs |
| Application mode | **Production** for a live site |
| Application root | The folder for your app's files, for example `myapp`. Keep it outside `public_html` |
| Application URL | The domain or address the app will answer on |
| Application startup file | Your app's main file, for example `app.js` or `server.js` |

**4. Create**

Click **Create**. cPanel sets up the app and its folder.

## Upload your code and install packages

**1. Upload your files**

Upload your app's files, including `package.json`, to the application root folder. Don't upload the `node_modules` folder. See [Upload files with File Manager or FTP](/cpanel/upload-files.md).

**2. Install packages**

Back in **Setup Node.js App**, edit your app and click **Run NPM Install**. This installs the packages listed in `package.json`.

**3. Start the app**

Restart the app from the same page, then open the application URL in your browser.

> [!NOTE]
>
> Your app must use the port it's given, not a fixed port. In your code, listen on `process.env.PORT`, for example `app.listen(process.env.PORT)`.

## After changing your code

Upload the changed files, run **Run NPM Install** again if `package.json` changed, then restart the app.

> [!TIP]
>
> Apps that need to run heavy background work around the clock, or use their own database server, may outgrow shared hosting. A HostCloud VPS gives you full control. See [Connect to your Linux VPS with SSH](/vps/access-your-vps-over-ssh.md).

Still stuck? [Open a ticket](/support/open-a-ticket.md) with your app's URL and any error shown on the Setup Node.js App page.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.