🌐
GitHub
github.com › nvm-sh › nvm
GitHub - nvm-sh/nvm: Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions
# Use bash for the shell SHELL ["/bin/bash", "-o", "pipefail", "-c"] # Create a script file sourced by both interactive and non-interactive bash shells ENV BASH_ENV /home/user/.bash_env RUN touch "${BASH_ENV}" RUN echo '. "${BASH_ENV}"' >> ~/.bashrc # Download and install nvm RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | PROFILE="${BASH_ENV}" bash RUN echo node > .nvmrc RUN nvm install · More robust, works in CI/CD-Jobs. Can be run in interactive and non-interactive containers. See #3531. FROM ubuntu:latest ARG NODE_VERSION=20 # install curl RUN apt update &&
Starred by 90.3K users
Forked by 9.7K users
Languages   Shell 98.0% | Makefile 1.2%
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-install-node-js-on-ubuntu-20-04
How to Install Node.js on Ubuntu | DigitalOcean
May 2, 2025 - Learn how to install Node.js on Ubuntu using apt, NodeSource, and NVM. Choose the best method for your needs with this beginner-friendly guide
People also ask

Is it possible to install a specific version of NVM?
Yes, you can install a specific version of NVM by specifying the version tag in the install command. Replace v0.35.3 in the curl command with the desired version tag: curl -o- https://raw.githubusercontent.com/nvm-sh/nvm//install.sh | bash.
🌐
monovm.com
monovm.com › 🐧 linux 🐧 › how to install nvm on ubuntu: step-by-step guide
How to Install NVM on Ubuntu: Step-by-Step Guide
Can I use NVM on other operating systems besides Ubuntu?
Yes, NVM is compatible with other Linux distributions and macOS.
🌐
monovm.com
monovm.com › 🐧 linux 🐧 › how to install nvm on ubuntu: step-by-step guide
How to Install NVM on Ubuntu: Step-by-Step Guide
🌐
Liquid Web
liquidweb.com › home › how to install node.js on ubuntu 22.04 via nvm
How to Install Node.js on Ubuntu 22.04 via NVM | Liquid Web
February 19, 2025 - NVM manages Node.js versions per user. If you need help setting up an initial user, refer to the Ubuntu 22.04 server setup guide. Dedicated hosting for your web services and applications ... NVM itself has some dependencies like curl, wget, gpg, etc. Install them with following command syntax:
🌐
GeeksforGeeks
geeksforgeeks.org › linux-unix › how-to-install-nvm-on-ubuntu-22-04
How to Install NVM on Ubuntu 22.04 - GeeksforGeeks
July 23, 2025 - Replace <version> with the desired Node.js version, such as 14.17.0 or lts. Installing the NVM on Ubuntu 22.04 is allows us to easily manage multiple versions of Node.js on the system which provides the flexibility and convenience for to your development projects.
🌐
AlexHost
alexhost.com › home › faq или база знаний › how to install nvm for node.js on ubuntu
How to Install NVM for Node.js on Ubuntu ⋆ ALexHost SRL
February 12, 2025 - By following this guide, you can easily install NVM, set up Node.js, and switch between different versions as needed. This makes managing Node.js dependencies across different projects simple and hassle-free. With NVM, you’ll always have the right version of Node.js for your projects, ensuring compatibility and ease of use. Happy coding! ... Modern websites and web applications rely heavily on databases, and MySQL hosting remains one of the most widely used... ... By default, Ubuntu ...
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-install-node-js-on-ubuntu-22-04
How to Install Node.js on Ubuntu (Step-by-Step Guide) | DigitalOcean
May 28, 2025 - Another way of installing Node.js that is particularly flexible is to use nvm, the Node Version Manager. This piece of software allows you to install and maintain many different independent versions of Node.js, and their associated Node packages, at the same time. To install NVM on your Ubuntu machine, visit the project’s GitHub page.
🌐
MonoVM
monovm.com › 🐧 linux 🐧 › how to install nvm on ubuntu: step-by-step guide
How to Install NVM on Ubuntu: Step-by-Step Guide
February 13, 2024 - Package Manager (apt): Verify that the apt package manager is installed on your Ubuntu system. This package manager is essential for fetching and managing software packages. Curl Installed: Confirm the presence of the curl command-line tool. If not installed, you can acquire it via the package manager by executing sudo apt install curl. Root or Sudo Access: Ensure you possess administrative privileges or sudo access to execute privileged commands required for installation and setup. To install Node Version Manager (NVM) on Ubuntu and manage multiple Node.js versions, follow these steps:
🌐
PhoenixNAP
phoenixnap.com › home › kb › devops and development › how to install nvm on ubuntu
How to Install NVM on Ubuntu | phoenixNAP KB
April 24, 2025 - This tutorial will explain how to install NVM on Ubuntu. ... Ubuntu installed. Access to the terminal. ... Note: Ensure Node.js isn't already installed via apt or snap before installing NVM, as it may cause conflicts.
Find elsewhere
🌐
TecAdmin
tecadmin.net › how-to-install-nvm-on-ubuntu-20-04
How To Install NVM on Ubuntu 20.04 – TecAdmin
April 26, 2025 - You need a running Ubuntu 20.04 Linux system with access to the terminal. Log in with the user account where you want to install Node.js. To install NVM, you need to run a shell script on your Ubuntu 20.04 system.
🌐
HeyNode
heynode.com › tutorial › install-nodejs-locally-nvm
Install Node.js Locally with Node Version Manager (nvm) | HeyNode
If you’re installing Node.js on your production environment you should consider using your OS’s package manager, or your server tooling of choice, to install and lock the environment to a specific version of Node.js. The official documentation for how to install nvm, and some common trouble shooting tips, is in the project’s README.
🌐
Vultr
docs.vultr.com › install-nvm-and-node-js-on-ubuntu-20-04
Install NVM and Node.JS on Ubuntu 20.04 | Vultr Docs
January 23, 2025 - $ ( cd "$NVM_DIR" git fetch --tags origin git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)` ) && \. "$NVM_DIR/nvm.sh" To install a specific version of Node.JS, specify the desired version number.
🌐
Host-World
host-world.com › how-to-install-nvm-on-ubuntu-step-by-step-tutorial
【How to Install NVM on Ubuntu: Step-by-Step Tutorial】 BLOG ᐈ Host-World.com
September 10, 2024 - In this guide, we will demonstrate how to install NVM on Ubuntu 22.04 (Jammy JellyFish) distribution. In addition, you will learn how to install and manage various Node.js versions effectively using NVM.
Top answer
1 of 4
90

I recommend using Node Version Manager:

NB: Node Version Manager (nvm) allows you to install multiple node versions and choose between them depending on which software you want to support; that is, manage multiple node versions.

Installing Node Version Manager

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash

Once you have Node Version Manager installed

  1. Confirm the available remote versions by running nvm ls-remote
  2. Run in your terminal nvm install <version> for example, nvm install 18 to install version 18 of Node
  3. List installed versions with nvm list
  4. Run nvm use 18 to start using version 18 of Node
  5. Note: you can be more explicit, for example: nvm install 14.17.0
2 of 4
29

Install nodejs v20 on Debian and Ubuntu based distributions

step 1 : Download and import the Nodesource GPG key

sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg

step 2 : Create deb repository

NODE_MAJOR=20
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list

optional: here we are installing nodejs v20 but if you want to install v18 change NODE_MAJOR=18 in above command. Similarly if you want to install nodejs v16 then change NODE_MAJOR=16.

step 3 : Run Update and Install

sudo apt-get update
sudo apt-get install nodejs -y

congratulations you just installed nodejs

To uninstall nodejs

sudo apt-get purge nodejs &&\
rm -r /etc/apt/sources.list.d/nodesource.list &&\
rm -r /etc/apt/keyrings/nodesource.gpg
🌐
Node.js
nodejs.org › en › download › package-manager
Node.js — Download Node.js®
# download and install Node.js (you may need to restart the terminal) nvm install 22 # verifies the right Node.js version is in the environment node -v # should print "v22.12.0" # verifies the right npm version is in the environment npm -v # should print "10.9.0"
🌐
Hostomy
hostomy.com › blog › how-to-install-node-version-manager-nvm-on-ubuntu-24-04
How to Install Node Version Manager (NVM) on Ubuntu 24.04 - Hostomy Blog
Simplicity: Install and manage Node.js directly from the command line. Before installing NVM, ensure your system is up-to-date: ... NVM requires curl and build-essential.
🌐
Ava
ava.hosting › home › faq › how to install nvm for node.js on ubuntu
How to Install NVM for Node.js on Ubuntu ⋆ AVA.HOSTING
March 26, 2025 - Node Version Manager (NVM) is a popular tool for managing multiple versions of Node.js on a single machine. It simplifies the process of installing, updating, and switching between different Node.js versions, making it an essential tool for Node.js developers. If you’re using Ubuntu, the installation of NVM is quick and easy.
🌐
GitHub
github.com › nvm-sh › nvm › issues › 2990
nvm install node fails to install on Ubuntu 22.04 · Issue #2990 · nvm-sh/nvm
December 28, 2022 - N/A iojs -> N/A (default) node -> stable (-> N/A) (default) unstable -> N/A (default) lts/* -> lts/hydrogen (-> N/A) lts/argon -> v4.9.1 (-> N/A) lts/boron -> v6.17.1 (-> N/A) lts/carbon -> v8.17.0 (-> N/A) lts/dubnium -> v10.24.1 (-> N/A) lts/erbium -> v12.22.12 (-> N/A) lts/fermium -> v14.21.2 (-> N/A) lts/gallium -> v16.19.0 (-> N/A) lts/hydrogen -> v18.12.1 (-> N/A) ... curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.39.3/install.sh | bash nvm install node
Published   Dec 28, 2022
🌐
DEV Community
dev.to › womakerscode › tutorial-instalando-o-node-js-e-o-node-version-manager-nvm-no-linux-ubuntu-e-derivados-202p
[Tutorial] Instalando o Node.JS e o Node Version Manager (NVM) no Linux (Ubuntu e derivados) - DEV Community
September 19, 2020 - Agora faremos a instalação do NVM que permitirá a instalação de várias versões do Node e nos permitirá alternar entre elas, caso necessário: