Back to Article List

How to run Node.js and Python apps in ispmanager

How to run Node.js and Python apps in ispmanager

In ispmanager a Node.js or Python app is a website with its own handler. The panel creates the site, starts your app under the PM2 process manager and sends the site's traffic to it through nginx. Your app has one job: listen on the socket, or the port, that the panel hands it in an environment variable.

Install Node.js and Python in ispmanager

Open Software configuration and install Node.js and Python. On my server Node.js took 10 seconds and Python 34 seconds, and the panel version didn't change despite the page's warning that it would be updated.

  • Node.js installs only the panel's module. No Node.js runtime goes onto the server itself: each site gets the version you pick, installed for its user when the site is created.
  • Python installed seven interpreters, from 3.8 to 3.14, under /opt/ispmanager/, about 650 MB in all.

Allow Node.js and Python for the user

Users that existed before the install don't get the new handlers. Open Users, edit the user who will own the app and tick Node.js and Python under Access, then save. Until you do, the handlers don't appear in that user's site form, which looks a lot like the install failed.

ispmanager user settings, Access section, with the Node.js and Python boxes ticked

Users created before the install need these two boxes ticked.

Create a Node.js site

Open Sites and create a site. In New website, set Handler to Node.js; the form notes that a CMS or website builder can't be installed with this handler. Choose the Node.js version. The default on my server was 26.14.0, and the list went back to 12.13.

ispmanager New website form with the Handler set to Node.js and the Node.js version list

The Node.js handler, with the version chosen per site.

Under Extended settings, the Handler (Node.js) section shows the paths to the user's node and npm and the Connection method, which is Socket file by default.

The site was ready in under two seconds. The panel installed Node.js for that user with nvm (about 270 MB), wrote a starter server.js and package.json into the site's folder and started the app under PM2. The starter listens on the path in the SOCKET environment variable, and so must your app. This is the test app I put in its place:

const http = require('http');
const fs = require('fs');
const server = http.createServer((req, res) => {
  res.setHeader('Content-Type', 'text/plain; charset=utf-8');
  res.end(`Hello from Node.js ${process.version} on ispmanager (path ${req.url})\n`);
});
if (process.env.SOCKET) {
  const s = process.env.SOCKET;
  if (fs.existsSync(s)) fs.unlinkSync(s);
  server.listen(s, () => fs.chmodSync(s, 0o660));
} else {
  server.listen(process.env.PORT || 3000, process.env.INSTANCE_HOST || '127.0.0.1');
}

It removes a socket file left by the previous run before listening, which saves a failed restart. After replacing server.js, restart the app from the site's Node.js actions in the panel. Mine answered on / and /hello alike: nginx sends every request to the app, even with an index.html in the folder. The site's Node.js settings also take a custom start command, a command to run before start and environment variables.

Get ispmanager on a server of your own

Pick a plan by how many websites you host. The panel comes installed and licensed, ready for your first login.
Abonament

Lite.VPS

$6.99 Save  14 %
$5.99 Lunar

20% reducere la licența ispmanager

Cea mai bună alegere pentru uz personal sau proiecte mici.

  • Până la 10 site-uri web
  • 50 GB NVMe stocare
  • 2 GB memorie RAM
  • 2 vCPU AMD EPYC
  • ✔Rețea de 1 Gbps nelimitată
  • ✔ IPv4 & IPv6 inclus Suportul pentru IPv6 nu este disponibil momentan în France, Finland sau the Netherlands.
  • ✔Backup automat inclus
  • ✔PHP, Python, Node.js suportate
  • Licența ispmanager se adaugă la checkout

Host.VPS

$22.99 Save  22 %
$17.99 Lunar

20% reducere la licența ispmanager

Creat pentru agenții, revânzători și medii de hosting cu capacitate mare.

  • Nelimitate site-uri web
  • 200 GB NVMe stocare
  • 8 GB memorie RAM
  • 4 vCPU AMD EPYC
  • ✔Rețea de 1 Gbps nelimitată
  • ✔ IPv4 & IPv6 inclus Suportul pentru IPv6 nu este disponibil momentan în France, Finland sau the Netherlands.
  • ✔Backup automat inclus
  • ✔PHP, Python, Node.js suportate
  • Licența ispmanager se adaugă la checkout

Create a Python site

Set Handler to Python. The Handler (Python) section under Extended settings has:

  • Application mode: Python web server (the default) or CGI through Apache
  • Path to server: server.py
  • Server arguments: empty by default
  • Connection method: Socket file by default
  • Python version: 3.14 by default

ispmanager New website, Extended settings, Handler (Python) section with Application mode, Path to server and Python version

The Python handler. "Python web server" means server.py serves HTTP itself.

The panel made a virtual environment in the site's folder (.venv, Python 3.14), an empty requirements.txt, a PM2 config and a starter server.py, then started the app under PM2.

"Python web server" means your server.py serves HTTP on the socket by itself: there is no built-in WSGI or Django mode. The app I tested used only the standard library:

import os, sys
from socketserver import UnixStreamServer
from wsgiref.simple_server import WSGIServer, WSGIRequestHandler, make_server

def application(environ, start_response):
    body = f"Hello from Python {sys.version.split()[0]} (WSGI) on ispmanager (path {environ.get('PATH_INFO')})\n".encode()
    start_response("200 OK", [("Content-Type", "text/plain; charset=utf-8"), ("Content-Length", str(len(body)))])
    return [body]

class UnixWSGIServer(UnixStreamServer, WSGIServer):
    def server_bind(self):
        UnixStreamServer.server_bind(self)
        self.server_name, self.server_port = "localhost", 80
        self.setup_environ()
    def get_request(self):
        req, _ = super().get_request()
        return req, ("local", 0)

if __name__ == "__main__":
    sock = os.environ.get("SOCKET")
    if sock:
        if os.path.exists(sock):
            os.unlink(sock)
        srv = UnixWSGIServer(sock, WSGIRequestHandler)
        os.chmod(sock, 0o660)
        srv.set_app(application)
    else:
        srv = make_server(os.environ.get("INSTANCE_HOST", "127.0.0.1"), int(os.environ.get("PORT", "8000")), application)
    srv.serve_forever()

After restarting it from the panel, mine answered 200 on / and /hello. A Flask or Django app needs its own production server, gunicorn for example, listed in requirements.txt, installed into .venv and bound to the same socket. I haven't run a framework app this way yet.

HTTPS for a Node.js or Python site

Both sites were created with "New free from Let's Encrypt" selected, and both still showed the self-signed placeholder certificate when I checked a few minutes later. Open SSL certificates after creating an app site and issue the certificate from there if it hasn't arrived; the SSL certificates guide has the steps.

Questions?

Does ispmanager install npm packages from package.json?

ispmanager can read a Node.js project's package.json and install its dependencies, according to ispmanager's own announcement of its improved Node.js support, and my server had panel functions for npm packages after the install. I tested only an app without dependencies, so I haven't seen that step run.

About the author

Linnea Håkansson

Linnea sings alto in a local choir in Göteborg and has been involved with it for several years. During the warmer months, she often spends weekends at a small family house north of the city, where the internet is unreliable enough that she generally leaves the laptop behind.

She studied language technology at the University of Gothenburg and started with terminology databases and localisation. She later joined a software company that kept its documentation in the same repository as its code, which she found considerably more interesting than the localisation spreadsheets. She writes and edits, and a good part of her work is navigation and content maintenance: consolidating older tutorials when several generations of a product have left different instructions for essentially the same task.

Run your sites on an ispmanager VPS

The panel comes installed and licensed, with full root access when you need it. Support is available 24/7.