Skip to content

Node.js on a VPS

JavaScript runtime

Category
Dev / Tools
Author
OpenJS Foundation
License
MIT
Version
24.21.0

The script is free · VPS from $2.79 per month · installs in about 60 seconds

Install over SSH

root@vps:~# curl -fsSL https://deb.nodesource.com/setup_24.x | sudo -E bash - && sudo apt-get install -y nodejs

  • SystemUbuntu 24.04 · x86_64ok
  • Sourcegithub.com/nodejs/nodeok
  • Version24.21.0ok

✓ Node.js 24.21.0 installed · about 60 seconds

root@vps:~#

Install command from the library. Output is shortened and may differ on your server.

What it is

  • JavaScript
  • Telegram bots
  • API
  • PM2

Node.js is a server-side JavaScript runtime. It powers Telegram bots (grammY, Telegraf), APIs, website backends and SSR apps on Next.js or Nuxt.

On a VPS a bot or API runs around the clock, with a static IP and without the limits of free hosting. Processes are best kept under PM2: it restarts the app on crashes and after a server reboot.

The command installs the current LTS branch 24 from the NodeSource repository, along with npm.

  • LTS version with long-term support
  • npm and access to the package registry
  • Suitable for bots, APIs and SSR
  • Updates via apt
  • Works with PM2 and systemd

Recommended plan

For Node.js: at least 1 vCPU, 2 GB RAM and 10 GB NVMe.

Minimum to run
1 vCPU · 1 GB RAM · 10 GB disk
Systems
Ubuntu 22.04 · Ubuntu 24.04 · Debian 11 · Debian 12

How to install

Three steps in the bot or one command over SSH; installation takes about 60 seconds.

  1. 01

    Choose a plan in the bot

    Open @ExpressHost_bot and pay for a VPS. The server will be ready in about 60 seconds.

  2. 02

    Add Node.js

    At the “Add-ons” step pick the script from the library, or run it later: Server settings → Scripts.

  3. 03

    Check versions

    node -v && npm -v

Manually over SSH

Connect to the server as root and run the command. Supported systems: Ubuntu 22.04, Ubuntu 24.04, Debian 11, Debian 12.

Install command
curl -fsSL https://deb.nodesource.com/setup_24.x | sudo -E bash - && sudo apt-get install -y nodejs

After installation

  1. 1.Check versions: node -v && npm -v
  2. 2.Install PM2: npm install -g pm2
  3. 3.Start the app and enable autostart: pm2 start app.js --name bot && pm2 startup && pm2 save

Node.js FAQ

Didn’t find an answer? Message @ExpressHost_SupportBot.

How many bots can a plan handle?

A simple Node.js bot uses 50–150 MB RAM. 1 vCPU and 2 GB fits several bots, as long as they don't process heavy files.

How do I switch to another Node.js version?

Run the NodeSource script for the branch you need (for example, setup_22.x) and run apt-get install nodejs again. For several versions at once, nvm is more convenient.

How do I view app logs?

pm2 logs bot. Logs are stored in ~/.pm2/logs.

Node.js installs at checkout — in the bot.