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.jsonand a startup file, such asapp.jsorserver.js. - A domain or subdomain for the app (see creating a subdomain).
Upload the code
- Create a folder outside
public_html, for example/home/user/myapp. Keeping code out of the web root protects your source files. - 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
- Go to cPanel → Software → Setup Node.js App.
- Click Create Application.
- Node.js version: choose the version your app needs, for example 20 or 22 LTS.
- Application mode: Production.
- Application root:
myapp(relative to your home directory). - Application URL: pick the domain or subdomain, and an optional path.
- Application startup file:
app.jsor your file name. - Add Environment variables such as
NODE_ENV=productionor API keys. - Click Create.
Install dependencies
- On the app's page, click Run NPM Install. It installs packages from
package.json. - 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 installor a build command.
source /home/user/nodevenv/myapp/20/bin/activate && cd /home/user/myappListen 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
- Click Start App (or Restart after changes).
- 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.
