Enabling Node.js for a Website
When creating or editing a website:
In the Handler field, select Node.js.
Select the Node.js version (latest and LTS versions starting from 12.13.0 are available).
Choose a Connection method:
Socket file – the Node.js app will use Unix sockets.
Port – the Node.js app will use a TCP port.
Adding a Node.js Project to a Website
Go to Websites → select the desired website.
Click Website files.
In the File Manager, click Upload.
Choose the upload method:
From local computer – click Select file or drag and drop files;
From URL – enter:
the URL of the file (e.g.
http://example.com/dir/file.html
);the File name (optional; if empty, it will be extracted from the URL).
Ensure that your
package.json
andserver.js
files are properly configured.Return to the website list → click “…” → Npm install.
Wait for the installation to complete (the Node.js icon will blink during the process).
After installation, click “…” → Restart (Node.js).
The Node.js icon will turn green, indicating the app is running correctly.
package.json
Configuration File
The package.json
file is used to manage project dependencies and application launch settings.
Default example:
{
"name": "doc.test",
"version": "1.0.0",
"description": "",
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.js"
},
"keywords": [],
"author": "",
"license": "ISC"
}
To edit this file:
Go to Websites → select the site → Configuration files.
To change the app path, modify the main
and start
fields accordingly.
To install packages listed in the file:
Go to Websites → select the site → … → Npm install.
System Directories
When using Node.js, the following directories are created in the user's home directory:
/var/www/<username>/data/.npm/
– npm data;/var/www/<username>/data/.nvm/
– installed Node.js versions;/var/www/<username>/data/.pm2/
– pm2 process manager data.
These directories are required for proper Node.js operation.
If deleted, they will be recreated, but some data may be lost.
Using the Shell Client
If the user has Shell access enabled:
Go to Websites → select the site → Shell client.
The control panel will automatically:
open the website's home directory;
add the Node.js paths to the
PATH
variable.
To close the shell client, simply exit the session.
Removing Node.js
Go to Software Configuration → Node.js → Disable.
This will remove Node.js and all related software (npm, pm2).
Removal is not possible if any websites are currently using Node.js.
Notes and Limitations
CMS installation and website builder tools are unavailable when Node.js is selected as the handler.
If your project files change, restart the site for changes to take effect:
Websites → select site → Restart.When restoring a Node.js website from a backup, ISPmanager will attempt to reuse the original port or socket.
If unavailable, a new one will be assigned.