How to install Node.js with nvm (multiple versions)
Updated 10/16/2026
Different projects may require different Node.js versions. nvm (Node Version Manager) lets you install them and switch between them easily.
1. Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc
2. Install a Node version
nvm install 20 # latest version 20
nvm install 18
3. Switch between versions
nvm use 18
nvm alias default 20 # the default version
4. Check
node -v
npm -v
Per project version
Put a .nvmrc file in the project with the desired version, then run nvm use in the directory to select it automatically.
In production
To run a Node app reliably, use PM2 or a systemd service, see how to deploy a Node.js app and how to create a systemd service.
Put this guide into practice on your own VPS
EU cloud servers, billed hourly, ready in minutes, with one-click installs for dozens of apps.
See pricingRelated tutorials
How to send WhatsApp messages from your apps with OpenWA
OpenWA gives you a REST API over WhatsApp, on your own server. Here is how to install it, connect it and send your first message, safely.
Updated 10/16/2026Dev environmentsHow to deploy an app from Git with Openship
From a Git repo to a live app, with a database, domain and SSL, on your own server, with no config files.
Updated 10/16/2026Dev environmentsHow to install PHP (multiple versions) and Composer
Install the PHP version your project needs, along with Composer for package management.
Updated 10/16/2026