Node.js on ISPmanager hosting

In the examples example.com is your domain. Use your own values.

A Node.js site is created like a normal one, but Node.js replaces PHP. The application runs all the time; the panel starts and restarts it.

1. Create the site

  1. "Sites" → "Create a site" → manual setup, or a Node.js project right away.
  2. Enter the domain in "Name", for example app.example.com.
  3. In "Additional features" untick "PHP". Only then the "Node.js" checkbox appears.
  4. Tick "Node.js".
The Node.js checkbox appears after PHP is unticked
The Node.js checkbox appears after PHP is unticked
  1. Choose a version in "Node.js version". An LTS release (24 or 22) is the safer choice.
  2. Click "Create".
Choosing the Node.js version
Choosing the Node.js version
Paths to node and npm of the chosen version
Paths to node and npm of the chosen version

The handler column shows the Node.js version.

Site with the Node.js handler
Site with the Node.js handler

2. What the panel created

The site folder has two sample files: server.js and package.json. The panel starts the app with npm start from package.json.

Node.js site files
Node.js site files

The key rule. The app must listen on the address the panel passes. By default it is a socket in the SOCKET variable. With "Use port" enabled in the site settings it is the port in PORT. A fixed port of your own will not work.

Express example:

const express = require('express');
const fs = require('fs');
const app = express();

app.get('/', (req, res) => res.send('Hello from Node.js!'));

if (process.env.SOCKET) {
  const socket = process.env.SOCKET;
  if (fs.existsSync(socket)) fs.unlinkSync(socket);
  app.listen(socket, () => fs.chmodSync(socket, 0o660));
} else {
  app.listen(process.env.PORT, process.env.INSTANCE_HOST);
}

Upload the app files to the site folder with the file manager, FTP or the Shell client.

3. Dependencies

  1. Site menu → configuration files. This is package.json. Check dependencies and the start script.
Node.js items in the site menu
Node.js items in the site menu
package.json in the panel editor
package.json in the panel editor
  1. Site menu → "Npm install" → "Install".
npm install
npm install

Installed packages: "View Node.js packages". You can also add or remove a single package there.

Installed Node.js packages
Installed Node.js packages

4. Run

"Run settings (Node.js)" defines the command. Pick a script from package.json or enter a command. Environment variables (API keys, NODE_ENV) and a pre-start command such as a build are set here too.

Run settings
Run settings

After code or settings changes: site menu → "Restart (Node.js)" → "Restart".

Restarting the application
Restarting the application
The application answers on the domain
The application answers on the domain

Node.js in the terminal

The "Shell client" item in the site menu opens a terminal in the site folder, with node and npm of the site version.

Shell client of a Node.js site
Shell client of a Node.js site

Application logs: "Site logs", files app.example.com-out.log (output) and app.example.com-error.log (errors).

Questions and answers
It appears only after you untick PHP.
It must listen on the socket in SOCKET or the port in PORT. A fixed port of your own will not work.
Site menu → "Npm install". Packages come from package.json.
Site menu → "Restart (Node.js)".
Open "Shell client" from the site menu. It already uses the site Node.js version.