How to Install Node.js on Ubuntu VPS
December 30, 2025
•
5 min read
•
VPS Management
Install Node.js on Ubuntu VPS
Complete guide to install Node.js and npm on your Ubuntu server.
Method 1: Using NodeSource Repository (Recommended)
# Install Node.js 20.x curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - sudo apt-get install -y nodejs # Verify installation node --version npm --version
Method 2: Using NVM (Node Version Manager)
# Install NVM curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash # Reload shell source ~/.bashrc # Install Node.js nvm install 20 nvm use 20 nvm alias default 20
Install Global Packages
npm install -g pm2 yarn
Setup PM2 for Process Management
# Start your app pm2 start app.js --name myapp # Auto-start on reboot pm2 startup pm2 save
Need managed VPS? WebHostWare VPS comes with Node.js pre-installed.
Need Managed VPS?
Skip the setup hassle. WebHostWare Managed VPS comes pre-configured with everything you need.
View VPS Plans