Hostxpeed
Login Get Started →
Getting Started

How to Install Node.js on VPS

3 min read
21 views
Jun 10, 2026

Prerequisites

Before installing Node.js, make sure you have:

  • SSH access to your VPS
  • Root or sudo privileges

Method 1: Using NodeSource Repository (Recommended)

Connect to your VPS:

ssh hxroot@YOUR_SERVER_IP -p 22

Install Node.js 18.x (LTS):

curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install -y nodejs

Method 2: Using Ubuntu Repository (Older Version)

apt install nodejs npm -y

Verify Installation

node --version
npm --version

Install PM2 (Process Manager)

npm install -g pm2

✅ Node.js has been installed on your VPS.

Was this article helpful?