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

# Using Node.js apps

Our cPanel hosting supports Node.js applications through the **Setup Node.js App** feature (CloudLinux Node.js Selector), letting you run Express, Next.js, and other Node.js applications alongside your PHP sites.

## Creating a Node.js application

1. Log in to cPanel.
2. In the **Software** section, click **Setup Node.js App**.

![image](https://files.readme.io/2f0d3fc-nodejs_app.png)

3. Click **Create Application** and complete the form:
   * **Node.js version:** pick the version your app requires.
   * **Application mode:** Development or Production.
   * **Application root:** the folder containing your app (e.g. nodeapp), relative to your home directory.
   * **Application URL:** the domain or subdomain/path where the app is served.
   * **Application startup file:** your entry point (e.g. app.js or server.js).
4. Click **Create**.

cPanel configures the environment and routes web traffic on your chosen URL to the application via Phusion Passenger.

## A minimal example app

Create app.js in your application root:

```javascript theme={null}
const http = require('http');

const server = http.createServer((req, res) => {
  res.writeHead(200, { 'Content-Type': 'text/plain' });
  res.end('Hello from Node.js on Stablepoint!');
});

server.listen(process.env.PORT || 3000);
```

<Note>
  Passenger sets the port — always listen on process.env.PORT rather than a hard-coded port.
</Note>

## Installing dependencies

After uploading your package.json:

* On the app's row in **Setup Node.js App**, click **Run NPM Install**, or
* Connect via [SSH](/web-hosting/files-and-access/secure-shell-ssh-overview), enter the app's virtual environment (the command is shown at the top of the app's edit page — it looks like `source /home/user/nodevenv/nodeapp/18/bin/activate`), and run `npm install`.

## Managing the application

From **Setup Node.js App** you can:

* **Restart** the app after deploying new code
* **Stop/Start** the app
* Set **environment variables** (e.g. NODE\_ENV, API keys)
* Change the Node.js version

## Troubleshooting

* Check the **stderr.log** in the application root for startup errors.
* "503" or Passenger error pages usually mean the app crashed on boot — the log tells you why.
* After any code change, click **Restart**.

For larger applications with heavy build steps or persistent processes beyond web requests, consider whether a plan with dedicated resources fits better — we're happy to advise.
