I really recommend you install node and npm using nvm. This is the fastest, cleanest and easiest way to do it.

That way, you install NVM simply doing:

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

To test that nvm was properly installed, close and re-open Terminal and enter nvm. If you get a nvm: command not found message, your OS may not have the necessary .bash_profile file. In Terminal, enter touch ~/.bash_profile and run the above install script again.

And you are now able to install node typing:

nvm install <version>

For example

nvm install 4.2.1

if you just want to install the latest node version, you can just type

nvm install node

In order to access node and npm as sudo (in order to have <1024 ports) you should run

n=$(which node)
n=${n%/bin/node}
chmod -R 755 $n/bin/* 
sudo cp -r $n/{bin,lib,share} /usr/local 
Answer from Luis González on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › node.js › installation-of-node-js-on-linux
Installation of Node.js on Linux - GeeksforGeeks
March 31, 2026 - Updated System: Package lists should be up-to-date. Internet Connection: Required to download Node.js and npm packages. The easiest way to install Node.js on Linux is through the default package manager.
🌐
Node.js
nodejs.org › en › download
Node.js — Download Node.js®
Download a signed Node.js source tarball. Check out our nightly binaries or all previous releases or the unofficial binaries for other platforms. We are able to serve Node.js's downloads and maintain our infrastructure proudly due to the support ...
Discussions

Linux: Best way to install node & npm
my preferred options. firstly, do not install from apt, it gets too old of versions instead, go to https://github.com/nodesource/distributions#debian-and-ubuntu-based-distributions which gives you a new apt repository, and then you can install from apt or, just use nvm ( https://github.com/nvm-sh/nvm ) or fnm ( https://github.com/Schniz/fnm ). fnm is nice because it does not lag shell startup as much as nvm. these latter two options may be better for dev than production, just since it is mostly installed to your local environment More on reddit.com
🌐 r/node
13
1
December 8, 2022
What is the correct way to install Node on a Debian-based Linux OS?
Go with the LTS version of node js since that is the version that gives long term support rather than dealing with the issues that might arrive from using the latest version. More on reddit.com
🌐 r/react
2
0
November 26, 2023
How do I install Node.js????
You could via this repository: https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions More on reddit.com
🌐 r/linuxmint
9
1
August 10, 2018
What's the command to install Node on Ubuntu?
https://nodejs.org/en/download More on reddit.com
🌐 r/MeshCentral
11
0
May 12, 2025
People also ask

What are the various ways to install Node.js on Linux?
You can install Node.js on Linux using the following methods:

Using a package manager (APT for Ubuntu/Debian, DNF/YUM for RHEL-based distros, Pacman for Arch)
Using Node Version Manager (NVM) – Best for managing multiple versions
Installing from NodeSource – Provides the latest version of Node.js
Downloading precompiled binaries from the official Node.js website
Building from source – Suitable for advanced users who need a custom build
🌐
cyberpanel.net
cyberpanel.net › blog › installing-node-js-on-linux
Installing Node.js on Linux: Step-by-Step Guide
What is Node.js, and why do I need it for Linux?
Node.js is a JavaScript runtime that lets you run JavaScript outside of the browser, mainly for server-side programming. It is used quite extensively for creating web applications, APIs, real-time apps, and microservices. installing Node.js on Linux enables developers to run and deploy JavaScript applications within a server environment efficiently.
🌐
cyberpanel.net
cyberpanel.net › blog › installing-node-js-on-linux
Installing Node.js on Linux: Step-by-Step Guide
Can I install Node.js without root/sudo access?
Yes, by using NVM, you can install and manage Node.js in your user directory without requiring root access.
🌐
cyberpanel.net
cyberpanel.net › blog › installing-node-js-on-linux
Installing Node.js on Linux: Step-by-Step Guide
🌐
OSTechNix
ostechnix.com › home › programming › nodejs › how to install nodejs on linux
How To Install NodeJS On Linux - OSTechNix
April 4, 2026 - In this tutorial, we will see how to install Nodejs on Linux operating systems such as Arch Linux, Debian, Ubuntu, RHEL, CentOS, Fedora etc.
🌐
CyberPanel
cyberpanel.net › blog › installing-node-js-on-linux
Installing Node.js on Linux: Step-by-Step Guide
June 2, 2025 - Learn installing Node.js on Linux using APT, YUM, NVM, or NodeSource. Step-by-step guide for Linux, Amazon Linux, Kali, and more.
🌐
LinuxConfig
linuxconfig.org › home › how to install node.js on linux
Install Node.js on Linux: A Step-by-Step Guide
September 22, 2025 - In this guide, we’ll show you how to install Node.js from the command line on various Linux distributions so you can get started hosting your JavaScript based website.
Find elsewhere
🌐
Webhosting UK
webhosting.uk.com › home › how to install node.js on linux (ubuntu, debian, centos)
How to Install Node.js on Linux – Ubuntu, Debian & CentOS Guide
March 24, 2026 - Install Node.js on Linux using apt, yum, or nvm. Step-by-step guide for Ubuntu, Debian, and CentOS with simple commands.
🌐
npm
docs.npmjs.com › downloading-and-installing-node-js-and-npm
Downloading and installing Node.js and npm | npm Docs
If you are unable to use a Node version manager, you can use a Node installer to install both Node.js and npm on your system. ... If you use Linux, we recommend that you use a NodeSource installer.
🌐
UpStack
upstackhq.com › upstack blog › software development
How To Install Node.JS On Linux (6 Minute Read) | Upstack
The first command downloads the setup file via curl, and the second command installs Node.js on the system. The example below details the command-line code needed to install Node.js 12 on Debian and Ubuntu. ... If Gentoo is your Linux distribution of choice, Node.js is available in the portage tree.
🌐
XDA Developers
xda-developers.com › home › linux guides › how to install node.js on linux
How to install Node.js on Linux
January 3, 2024 - Then, run the command sudo dnf install nodejs npm. ... If you want to see if Node is installed properly, you can run the command node -v or node --version. If you're still having issues, you can follow the steps on the Node.js website for your ...
🌐
Treehouse
treehouse.github.io › installation-guides › linux › node-linux.html
Installing Node.js® and NPM on Linux
The whole process (after you have Linuxbrew installed) should only take you a few minutes. Open up your terminal and type brew install node. Sit back and wait. Homebrew has to download some files, compile and install them. But that’s it. Make sure you have Node and NPM installed by running ...
🌐
Liquid Web
liquidweb.com › home › how to install node.js on linux (almalinux)
How to install Node.js on Linux (AlmaLinux) | Liquid Web
April 4, 2025 - Replace with the Node.js version you want to install. For example, to install Node.js 18 on Linux, run the following command:
🌐
MtxServ
mtxserv.com › vps › vps guides › how to install node.js on linux?
How to install Node.js on Linux? - mTxServ
April 15, 2021 - You can check the list of Node.js versions still maintained here (nodejs.org). We will install the 14 version which is in LTS (long term support). curl -sL https://deb.nodesource.com/setup_14.x | bash - apt update && apt install -y nodejs
🌐
Carmatec
carmatec.com › home › how to install node.js and npm on windows, macos & linux (2025 guide)
How to Install Node.js and npm on Windows, macOS & Linux (2025 Guide)
February 17, 2026 - Follow the prompts to complete the installation. ... Open Terminal. Run the following command to update the package index: sudo apt update ... In Terminal, type node -v to check the Node.js version.
🌐
WafaiCloud Blogs
wafaicloud.com › blog › setting-up-node-js-on-your-linux-machine
Setting Up Node.js on Your Linux Machine – WafaiCloud Blogs
September 4, 2025 - Node.js can be installed via various methods, including binaries, package managers, or using Node Version Manager (nvm). We’ll cover the latter for its flexibility. ... After installation, you need to set up your shell to recognize nvm. Add the following lines to your ~/.bashrc, ~/.bash_profile, or ~/.zshrc, depending on your shell type:
🌐
Pmbanugo
pmbanugo.me › home › blog › how to install node.js on ubuntu and linux distros
How to Install Node.js on Ubuntu and Linux Distros: A Complete Guide
January 21, 2025 - This guide shows you how to install Node.js on Ubuntu using two popular version managers: fnm and nvm. Node.js version managers help you install and switch between different Node.js versions easily.
🌐
GeeksforGeeks
geeksforgeeks.org › installation guide › install-node-js-windows-macos-linux
How To Install NodeJS on Your System? - GeeksforGeeks
July 23, 2025 - Visit the Node.js official site and download the macOS installer for either the LTS v22.12.0 or Current version v23.3.0 ... Open the downloaded .pkg file and follow the instructions to complete the installation.
🌐
Snapcraft
snapcraft.io › node
Install Node.js Runtime on Linux | Snap Store
1 month ago - A JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js' package ecosystem, npm, is the largest ecosystem of open source libraries in the world. https://nodejs.org/ Select architecture · The build and commit information is derived from build infrastructure records. Choose your Linux distribution to get detailed installation instructions.
🌐
DEV Community
dev.to › crit3cal › how-to-install-nodejs-on-linux-2fio
How to Install NodeJs on Linux - DEV Community
July 1, 2025 - The easiest way to install Node.js on a Linux system is by using the official package manager of your distribution.