DroxinRepair & Hosting
Web Hosting Issues

How to Deploy a Node.js App on cPanel (Step by Step)

  • October 23, 2026
  • 97 views
  • Droxin repair team
How to Deploy a Node.js App on cPanel (Step by Step) Need a server for this? Node.js hosting with cPanel from $2.50/mo — set up for exactly this guide.

Most cPanel hosts that support Node.js do it through one screen: Setup Node.js App (part of CloudLinux). It looks simple, but a few details decide whether your app runs on the first try or greets you with a 503 Service Unavailable. This guide walks through a clean deployment of an Express, Fastify, NestJS or Next.js app, start to finish.

Before you start

  • Your app must start from one file — usually app.js, server.js or index.js. Frameworks with their own CLI (Next.js, Nuxt) need a tiny starter file; see below.
  • Listen on the port you are given. Use app.listen(process.env.PORT || 3000). cPanel's app server connects your domain to whatever port the process listens on, so never hard-code 80 or 443.
  • Know your Node.js version. Check the engines field in package.json or what you use locally (node -v). A version mismatch is the most common cause of a crash on start.

1. Upload the code

Create a folder outside public_html, for example /home/youruser/myapp, so your source code and .env are never downloadable. Upload your project there with the cPanel File Manager (zip it, upload, extract), with SFTP, or with git clone over SSH. Don't upload node_modules — it's rebuilt on the server.

2. Create the application

In cPanel open Setup Node.js App → Create Application and fill in:

  • Node.js version — the one your app was built for.
  • Application mode — Production.
  • Application root — the folder from step 1 (e.g. myapp).
  • Application URL — your domain, or a path such as /api.
  • Application startup file — e.g. server.js.

Press Create. cPanel builds a private Node environment for the app and wires your domain to it.

3. Install dependencies

Once the app exists, a Run NPM Install button appears (it reads your package.json). If you prefer the terminal, the same screen shows a command like source /home/youruser/nodevenv/myapp/20/bin/activate && cd /home/youruser/myapp — paste it in SSH, then run npm ci or npm run build as you would locally.

Rather skip the setup? Node.js hosting with cPanel from $2.50/mo — always on, database included, and we fix the app if it won't start.

4. Environment variables

Add NODE_ENV, database URLs and API keys under Environment variables on the same page instead of committing a .env file. Press Save, then Restart — variables are only read when the app starts.

5. Next.js and other framework CLIs

The app server starts a file, not npm start. For Next.js, run npm run build over SSH, then use a small server.js as the startup file:

const { createServer } = require('http');
const next = require('next');
const app = next({ dev: false });
const handle = app.getRequestHandler();
app.prepare().then(() => {
  createServer((req, res) => handle(req, res)).listen(process.env.PORT || 3000);
});

6. HTTPS and the database

cPanel's AutoSSL issues the certificate for your domain automatically; once it shows as valid, force HTTPS in Domains. Create a MySQL database and user in MySQL Databases, and connect to localhost from your app.

If it shows 503 or a blank page

That almost always means the process crashed while starting — a missing dependency, a wrong startup file, an ES-module/CommonJS mix-up, or a variable that isn't set. We wrote a separate guide for exactly this: Node.js app shows 503 on cPanel — how to fix it.

Want it done for you?

On Droxin Node.js hosting all of this is ready on fast NVMe servers, and our engineers will deploy the first version with you — and fix it if it ever breaks. Already on another host and stuck? Send us the site; you pay only after it's working.

Host your Node.js app with us — from $2.50/month

Node.js hosting with cPanel: pick the Node version, npm install and restart from the panel, SSH, free SSL and daily backups. Choose your own CPU, RAM and storage, no contract. If the app won't start, our team fixes it.

See Node.js hosting plans

Already hosted elsewhere and stuck? Get a free diagnosis.

More from the blog