Skip to content

Node.js

A Node.js website runs your app as its own process, behind Nginx. Netkeel keeps it running and restarts it for you. Create a Node.js server first, then add a website to it.

When you add a Node.js website, you also choose:

  • Node.js version: 20, 22 or 24. Node.js 22 is recommended.
  • Start command: the command that starts your app, such as npm start or node server.js. It runs in the app’s folder as the website’s own user. Up to 512 characters, on one line. The default is npm start.
  • Health check path: a page on your app, such as / or /health. It starts with /. Netkeel requests it before the app counts as started. The default is /.
  • Whether to Create a MySQL-compatible database (MariaDB). It is ticked at first; untick it if the app doesn’t need a database.

The website starts with a placeholder app (package.json and server.js) that npm start runs. You can change all of these later under Node.js app.

You can deploy from Git, or upload with SFTP or the file manager into htdocs and then click Restart under Node.js app.

Open Hosting › Deployments and connect your repository. The Node.js preset fills in:

  • Build commands: npm ci and npm run build --if-present. They run with the website’s Node.js version.
  • Shared paths: .env, kept between releases.
  • Publish directory: empty, the repository root.

When you connect the repository, the environment variables you set under Node.js app are copied to Deployments, and you edit them there from then on.

After a new release is built and switched to, Netkeel restarts the app and requests its health check path. The app must answer with a success or redirect status (HTTP 200 to 399) within 30 seconds.

If it doesn’t, the website goes back to the previous release and the app runs again from it. The deploy shows Failed with Not switched to: the previous release is still live. Click Log: it ends with the health check’s result, such as the app is not listening yet or the status code it got, and the app’s last output.

Common causes:

  • The app listens on a fixed port instead of PORT.
  • The health check path needs a login or returns an error. Choose a path that answers without one.
  • The app needs an environment variable that isn’t set under Deployments.

If the app is stopped when you deploy, the new release goes live but the app is not started. Click Start under Node.js app.

Open the website and go to Hosting › Node.js app.

The Status card shows whether the app is Running, Starting, Stopped or Failed, with its Uptime, Memory, Restarts, Node.js version, Start command, Health check path and where it is Listening on. It refreshes every 10 seconds while the page is open.

  • Start starts a stopped app.
  • Restart restarts it, for example after you upload new files.
  • Stop stops it. The website shows an error page until you start the app again.

Anyone with access to the website can start, stop and restart the app.

The Owner and Super admins can click Edit settings to change the Node.js version, start command or health check path. Click Save and restart: the app restarts with the new settings.

Recent log shows the app’s latest output. Values of your environment variables are hidden. Click Refresh to read it again.

The Owner and Super admins can set variables here. They are passed to the app when it starts. Saved values are never shown again; to keep one, leave it empty when you edit the list.

When the website is deployed from Git, its variables live under Deployments instead, and apply from the next deployment. Click Edit under Deployments to go there.

Node.js websites don’t run PHP. Staging, cloning, moving to another server and import and export are WordPress-only for now. Backups work as for every website.