Quick answer
How do you deploy a Node.js app on a VPS?
To deploy a Node.js app on a VPS, create an app user, install the current LTS, Node 26, with nvm, copy the code, run it as a systemd service on 127.0.0.1:3000, then put nginx in front as a reverse proxy with HTTPS. JadeKVM servers give root on a KVM kernel, so pm2 works too.
In brief
- No root for the app: run it as a plain user with its own home folder.
- Node 26 LTS: nodejs.org listed it as the latest LTS on 16 November 2026.
- systemd or pm2: both restart a crashed app and start it at boot.
- nginx in front: the app listens on 127.0.0.1; nginx serves ports 80 and 443.
How to deploy a Node.js app on a VPS in 6 steps?
The example app listens on port 3000 and starts with node server.js.
Create an app user
Run
sudo adduser --disabled-password appand switch to it withsudo -iu app.Install Node.js
Install nvm, then run
nvm install --lts. Note the path thatwhich nodeprints.Copy the code
Clone the repository or upload it with rsync, then run
npm ci --omit=dev.Create the service
Write a systemd unit with that node path, Restart=on-failure and the app user.
Add nginx
Proxy example.com to http://127.0.0.1:3000 and reload nginx.
Add HTTPS
Run certbot for nginx so the proxy serves TLS.
Which is better for a Node.js app: systemd or pm2?
| Point | systemd service | pm2 | Best for |
|---|---|---|---|
| Install | Built into Debian and Ubuntu | npm install -g pm2 | systemd: nothing extra |
| Restart on crash | Restart=on-failure | Automatic | Tie |
| Start at boot | systemctl enable | pm2 startup, pm2 save | Tie |
| Logs | journalctl -u app | pm2 logs | systemd: one place for all services |
| Cluster mode | One unit per process | pm2 start -i max | pm2 on multi-core plans |
How do you install Node.js 26 LTS with nvm?
Install nvm as the app user, then let it fetch the LTS build. The distro packages lag: Ubuntu 24.04 ships Node 18 in its archive. nvm installs current versions into the user's home, with no root needed.
The nvm release used here, v0.41.0, is the one its README showed on 16 November 2026. Check the README for a newer tag before you run it.
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.41.0/install.sh | bash
source ~/.bashrc
nvm install --lts
node -v
which nodeHow do you run the app as a systemd service?
Write a unit file that names the user, the folder and the full node path, then enable it. Paste the path printed by which node into ExecStart. systemd restarts the app 5 seconds after a crash and starts it at boot.
Keep secrets in an environment file readable by root only. Logs go to the journal: journalctl -u app -f follows them live.
[Unit]
Description=Node.js app
After=network-online.target
Wants=network-online.target
[Service]
User=app
WorkingDirectory=/home/app/myapp
ExecStart=/home/app/.nvm/versions/node/v26.13.1/bin/node server.js
Environment=NODE_ENV=production PORT=3000 HOST=127.0.0.1
EnvironmentFile=-/etc/app.env
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.targetHow do you put nginx in front of the Node.js app?
A short server block passes requests to 127.0.0.1:3000 and keeps WebSocket upgrades working. Run sudo systemctl daemon-reload and sudo systemctl enable --now app first. Then add the block below and reload nginx.
The guide on how to host a website on an Asia VPS explains sites-available. Certbot then adds TLS, as in how to install a free SSL certificate.
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}Which is the best VPS city for a Node.js API in Asia?
Place the API next to its main clients. JadeKVM read WonderNetwork's public pings on 16 November 2026: Tokyo sits 104 ms from San Francisco, Hong Kong 162 ms. Singapore sits 55 ms from Mumbai. Latency figures on JadeKVM pages are public averages measured by WonderNetwork between its own servers on 16 November 2026; they show how far apart the cities sit on the network, not a promise about any one JadeKVM server. An API serving both Asia and the US West Coast often fits Tokyo; see the US West Coast page.
Pendant offers 1 shared vCPU, 3 GB RAM, 45 GB NVMe, 1 TB a month, enough for most APIs.
Questions about deploying Node.js on a VPS
Which Node.js version should I deploy in 2026?
The current LTS line. On 16 November 2026, nodejs.org listed Node 26 as the latest LTS, with 24 and 22 still supported.
Is pm2 better than systemd for Node.js?
pm2 adds cluster mode and a friendly CLI. systemd needs no extra tool. Both restart a crashed app and survive reboots.
Should the Node.js app listen on port 80?
No. Keep it on 127.0.0.1 with a high port and let nginx handle 80 and 443.
How do I deploy updates?
Pull the new code, run npm ci, then sudo systemctl restart app. Keep the old release folder for a quick rollback.
Can the app send email?
Yes, through a mail provider on port 465 or 587. Outbound port 25 is closed on JadeKVM servers.
Verdict
- A plain user, Node LTS via nvm, a systemd unit and nginx in front is a robust Node.js deployment.
- Choose pm2 if you want cluster mode on a multi-core plan such as Bangle.
Sources (6)
- Download Node.js — OpenJS Foundation (read 2026-11-16)
- nvm, Node Version Manager — nvm-sh (read 2026-11-16)
- systemd.service(5) manual page — freedesktop.org / systemd (read 2026-11-16)
- PM2 startup script — PM2 (read 2026-11-16)
- ngx_http_proxy_module — nginx.org (read 2026-11-16)
- WonderNetwork: pings from Tokyo wondernetwork.com/pings/Tokyo — WonderNetwork (read 2026-11-16)
Deploy your Node.js app in Tokyo
Pendant offers 1 vCPU / 3 GB / 45 GB for $4.50 a month on 12 months.
- Built by a person, 1 hour at most after confirmation
- Lost days credited back if a server cannot be delivered
- Pay in BTC, XMR, USDT, USDC, ETH, SOL or LTC
- DomaineGoat LLC · Panama