DevOps

How to Install NVM on Ubuntu (Node Version Manager)

UbuntuNode.jsNVMDevOps

Introduction

NVM (Node Version Manager) allows you to install and manage multiple Node.js versions on a single Ubuntu machine. This is especially useful when working on multiple projects requiring different Node versions.


Step 1 — Update System Packages

sudo apt update && sudo apt upgrade -y

Step 2 — Install Required Dependencies

sudo apt install curl build-essential -y

Step 3 — Download and Install NVM

curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

Step 4 — Load NVM into Your Shell

source ~/.bashrc

Or if using ZSH:

source ~/.zshrc

Step 5 — Verify NVM Installation

nvm --version

Step 6 — Install Latest Node.js Version

nvm install node

Step 7 — Install a Specific Node.js Version

nvm install 18

Step 8 — List Installed Node Versions

nvm ls

Step 9 — Switch Between Node Versions

nvm use 18

Step 10 — Set a Default Node Version

nvm alias default 18

Step 11 — Check Current Node & NPM Version

node -v
npm -v

Step 12 — Uninstall a Node Version (Optional)

nvm uninstall 16

Useful NVM Commands

| Command | Description | |--------|------------| | nvm install node | Install latest Node | | nvm install 18 | Install Node 18 | | nvm use 18 | Switch Node version | | nvm ls | List installed versions | | nvm alias default 18 | Set default Node | | nvm uninstall 16 | Remove Node version |


Troubleshooting

If nvm command not found:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

Conclusion

NVM makes Node.js version management easy and flexible.


Author

Marquefactory DevOps Team

Need help applying this?

Discuss your software idea, product roadmap, or internal system

If this article connects to a product idea, workflow problem, MVP plan, or custom platform requirement, we can help you turn it into a scoped delivery plan. MarqueFactory works with founders and businesses that need senior technical judgment, not just implementation tickets.

  • MVP planning and custom SaaS development
  • Web apps, mobile apps, and internal systems
  • Architecture, delivery roadmap, and build estimates
  • Senior-led product and engineering guidance

Related Services

If this topic connects to a real build, these are the pages most likely to help you evaluate fit, scope, and delivery approach.

Useful Tools

These free tools are useful on their own, and they also reflect the kinds of systems we help businesses turn into custom platforms.

Related Articles