CloudLinux

How to set up a Node.js app in cPanel with CloudLinux Node.js Selector

Deploy a Node.js application on cPanel hosting with Setup Node.js App: choose the Node version, set the startup file, install npm packages and run it on your domain.

IntermediatecPanel hosting with CloudLinux2 min read

CloudLinux's Node.js Selector lets you run Node.js applications such as Express APIs, Next.js standalone builds or bots on normal cPanel hosting. The app runs through LiteSpeed/Passenger on your domain or a subdomain, with no need to open ports.

Before you start

  • cPanel access with Setup Node.js App in cPanel → Software.
  • Your app's code with a package.json and a startup file, such as app.js or server.js.
  • A domain or subdomain for the app (see creating a subdomain).

Upload the code

  1. Create a folder outside public_html, for example /home/user/myapp. Keeping code out of the web root protects your source files.
  2. Upload your files there with File Manager, FTP or Git. Do not upload node_modules; you will install dependencies on the server.

Create the application

  1. Go to cPanel → Software → Setup Node.js App.
  2. Click Create Application.
  3. Node.js version: choose the version your app needs, for example 20 or 22 LTS.
  4. Application mode: Production.
  5. Application root: myapp (relative to your home directory).
  6. Application URL: pick the domain or subdomain, and an optional path.
  7. Application startup file: app.js or your file name.
  8. Add Environment variables such as NODE_ENV=production or API keys.
  9. Click Create.

Install dependencies

  1. On the app's page, click Run NPM Install. It installs packages from package.json.
  2. Or use the command shown at the top of the page in cPanel → Advanced → Terminal to enter the app's virtual environment, then run npm install or a build command.
source /home/user/nodevenv/myapp/20/bin/activate && cd /home/user/myapp

Listen on the right port

Passenger passes the port to your app. Use the PORT environment variable instead of a fixed number:

const port = process.env.PORT || 3000; app.listen(port);

Start and test

  1. Click Start App (or Restart after changes).
  2. Open the application URL. You should see your app's response.

Tip: Restart the app from Setup Node.js App every time you change code or environment variables; Node does not reload files automatically.

Limits to keep in mind

  • The app runs inside your account's CloudLinux limits, so long-running heavy jobs can hit memory or CPU limits (see Resource Usage).
  • WebSockets and background workers may be limited on shared hosting. For those, a VPS is a better fit.

If the app does not start, see troubleshooting Node.js apps.

Frequently asked questions

Can I run Next.js this way?

Yes, using a custom server or the standalone output with a startup file such as server.js. Build the app first, then start it with the selector.

Where are logs?

Errors are written to a stderr.log file in the application root, or to the log path set on the app page. Check it first when the app fails.

How do I deploy updates?

Upload or git pull the new code into the application root, run npm install if package.json changed, then click Restart.

Can I use a database?

Yes. Create a MySQL database in cPanel and connect with a driver such as mysql2, using localhost as the host.

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.