Lightning‑Fast Guide to Installing Node.js on Linux (Ubuntu, Fedora, Arch) — 2025 Edition 🚀

Installing Node.js on Linux does not have to be a maze of tutorials and conflicting advice. In fact, you can be up and running in just a few minutes if you know the right commands for your distribution and follow a clear verification step. This article walks you through the entire process for the three most popular Linux families—Ubuntu / Debian, Fedora, and Arch / Manjaro—then shows you how to confirm the installation and, if you’re a developer juggling multiple projects, how to add the flexibility of Node Version Manager (NVM). By the end, you’ll have a clean, modern Node.js environment that’s ready for anything from hobby scripts to production micro‑services.


Refreshing your package lists

Begin by making sure your operating‑system repositories are up to date. On Ubuntu or Debian, open a terminal and run sudo apt update && sudo apt upgrade -y. Fedora users achieve the same with sudo dnf upgrade --refresh -y, while Arch or Manjaro users should enter sudo pacman -Syu. Performing this refresh first eliminates version‑mismatch headaches and ensures you pull in the latest security patches before you add Node.js.


Installing the Long‑Term‑Support build of Node.js and npm

With the system current, you can install Node.js along with its companion package manager, npm. If you’re on Ubuntu or Debian, installing is as simple as sudo apt install nodejs npm -y; the distro repositories track the current LTS stream and bundle both tools together. Fedora organizes language stacks into “module” streams, so type sudo dnf module install nodejs:20/common -y, replacing 20 with whatever the current LTS stream is when you read this. Arch and Manjaro maintain the very latest release directly in their community repository, so just run sudo pacman -S nodejs npm. In every case you now have the Node runtime and npm locked in and managed by your distribution’s package system, so future security updates arrive automatically.


Verifying the installation

Never assume an install succeeded—verify it. In the same terminal, type node -v; you should see a version string such as v20.11.1. Follow with npm -v and note a second version number. For extra peace of mind, create a tiny script:

echo "console.log('Node.js on Linux works!');" > test.js
node test.js

Seeing the text “Node.js on Linux works!” means your runtime can execute JavaScript without issues. Congratulations—Node and npm are live.


Adding flexibility with Node Version Manager

If you work on multiple projects that depend on differing Node versions, install NVM. One line fetches the installer:

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

Reload your shell (source ~/.bashrc or source ~/.zshrc), then install the latest LTS release by running nvm install --lts and activate it with nvm use --lts. Need to test against Node 18 while your main project uses Node 20? Just type nvm use 18 or nvm use 20 and switch instantly. Because NVM operates entirely within your home directory, it never clashes with system‑wide packages or requires sudo.


Conclusion

A quick repository refresh, one install command, and a simple version check are all you need to run JavaScript natively on Linux. Whether you rely on the distribution’s own package or prefer the flexibility of NVM, this streamlined approach keeps your environment clean, secure, and adaptable. Now you can move straight to building APIs, automating workflows, or deploying full‑stack applications—confident that your Node.js foundation is rock‑solid. Happy hacking, and may every npm install finish faster than you expect!