either download the linux binaries from this page: https://nodejs.org/en/download/

Direct link: https://nodejs.org/dist/v10.15.3/node-v10.15.3-linux-x64.tar.xz Just unpack them

you can also use the official nodesource distro packages using the instructions at https://github.com/nodesource/distributions/blob/master/README.md

# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs

which would be my prefered way to achieve this.

Answer from Phillip -Zyan K Lee- Stockmann on askubuntu.com
🌐
Node.js
nodejs.org › en › download
Node.js — Download Node.js®
1 day ago - N/A Installer (.gz)Standalone Binary (.gz) Read the changelog or blog post for this version. Learn more about Node.js releases, including the release schedule and LTS status. Learn how to verify signed SHASUMS. Looking for Node.js source? Download a signed Node.js source tarball.
Discussions

node.js - Installing a tar.gz on Linux - Stack Overflow
If you're installing it locally on your own machine, you can just untar it, tar xvfz node*tar.gz, to your home directory, add this to the file ~/.bashrc, and append the directory path your your PATH environment variable like so PATH=$PATH:/home/USERNAME/DIRECTORY/bin. More on stackoverflow.com
🌐 stackoverflow.com
node.js - How to install node.tar.xz file in linux - Stack Overflow
I recently downloaded the Nodejs file from the official site and I don't know how to install the Nodejs from a archived file. Please help me how can I install this file so that I can run the "... More on stackoverflow.com
🌐 stackoverflow.com
How do i install nodejs on Ubuntu 14.04 after downloading the package (.tar) from nodejs.org
How do i install nodejs on Ubuntu 14.04 after downloading the package (.tar) from nodejs.org#418 · Copy link · Assignees · zenismaharjan · opened · on Dec 23, 2016 · Issue body actions · No description provided. gibfahn · No labels · No labels · No type · More on github.com
🌐 github.com
15
December 23, 2016
Npm package.json to tar.gz
npm install? If you only want the dependencies, tar the `node_modules` but it's bad practice. More on reddit.com
🌐 r/node
6
0
March 11, 2019
Top answer
1 of 13
59

You can download this file from the browser or from the console. The latter is shown below (note: the specific Node.js version might be different for you):

Example :

wget http://nodejs.org/dist/v8.1.1/node-v8.1.1-linux-x64.tar.gz

sudo tar -C /usr/local --strip-components 1 -xzf node-v8.1.1-linux-x64.tar.gz

 #tar options:

 -x, --extract, --get
   extract files from an archive

 -f, --file ARCHIVE
   use archive file or device ARCHIVE

 -z, --gzip, --gunzip --ungzip`

You may find list of node version on http://nodejs.org/dist/

You should now have both Node.js and npm installed in “/usr/local/bin”. You can check this typing:

ls -l /usr/local/bin/node ls -l /usr/local/bin/npm

*An alternative way to install Node.js via the package manager:

Installing Node.js via package manager

2 of 13
26

As @mckenzm had pointed out the approach of dumping the contents of the archive into the in-path folders like /usr/local/bin/ is not a great one. You will be in a lot of trouble when you have to remove this and upgrade to the next version due to some security issue.

The following are two approaches to follow

Manual installation

The approach to follow is to keep it in a way that it is easy to remove and upgrade, the way to do it is to keep all the stuff in one place and add that place to your path, for that One can do

sudo tar -xf node-v20.11.0-linux-x64.tar.xz --directory=/opt/

and add the bin folder to your $PATH variable using the following

echo 'export PATH="/opt/node-v20.11.0-linux-x64/bin/:$PATH"' >> ~/.bashrc && source ~/.bashrc

This is a better approach because you can remove it, and upgrade it easily compared to just dumping all the files in the /bin folder, like many, including my previously written answer ( deleted now ), are telling.

Now on any given day, you can remove the entire folder from /opt and replace it with the version you want or even you can use multiple versions at the same time.

Using tools like nvm

node version manager is a tool, that can be very useful, specially for personal use, when you might need more than one version, you can install it via reading the documentation - it is very simple to do and nvm is a very useful script - for more visit https://github.com/nvm-sh/nvm?tab=readme-ov-file#install--update-script

If you ask me, I prefer the nvm approach.

🌐
Rheinwerk Computing
blog.rheinwerk-computing.com › how-to-install-node.js-on-windows-mac-and-linux-systems
How to Install Node.js on Windows, Mac, and Linux Systems
April 24, 2025 - The package is available as a zipped tar archive, and all you have to do is unzip it on the command line, as shown here. $ wget https://nodejs.org/dist/v16.8.0/node-v16.8.0-darwin-x64.tar.gz ·
🌐
MageComp
magecomp.com › home › nodejs › how to install node.js on mac?
How to Install Node.js on Mac?
September 8, 2023 - You can download and install Node.js manually from the official website: Step 1: Visit Node.js site https://nodejs.org/en/download · Step 2: Click on the appropriate installer for Mac (.pkg or .tar.gz) to download the Node.js installer.
Find elsewhere
🌐
Codegive
codegive.com › blog › install_node_js_from_tar_xz.php
Install Node.js from tar.xz (2026): Unleash Control, Conquer Manual Installs, & Master Your Environments!
Master how to install Node.js from tar.xz archives. Gain unparalleled control over versions, environments, and dependencies—even without root access.
🌐
TutorialsTeacher
tutorialsteacher.com › nodejs › setup-nodejs-development-environment
Install Node.js on Windows or Mac
Visit Node.js official web site https://nodejs.org/en/download page. Click on the appropriate installer for Mac (.pkg or .tar.gz) or Linux to download the Node.js installer.
🌐
Codegive
codegive.com › blog › install_node_js_using_tar_gz.php
Mastering Node.js: How to Install Node.js Using tar.gz for Ultimate Control & Offline Power (2024)
To install Node.js from a tar.gz file, download the archive, extract it to a desired location, and then update your system's PATH environment variable to include the Node.js executable directory.
Top answer
1 of 2
31

If you want to install and switch between multiple versions of node then nvm (Node.js version manager) is better option.

  1. Check whether you have nvm or not. If not then you can pull down the nvm installation script from the project's GitHub page. The version number may be different, but in general, you can download it with curl:

    curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh -o install_nvm.sh
    

    Run the script with bash:

    bash install_nvm.sh
    

    It will install the software into a subdirectory of your home directory at ~/.nvm. It will also add the necessary lines to your ~/.profile file to use the file.

    To gain access to the nvm functionality, you'll need to log out and log back in again, or you can source the ~/.profile file so that your current session knows about the changes:

    source ~/.profile
    

  1. If you have multiple Node.js versions, you can see what is installed by typing:

    nvm ls
    
  2. You can install your specific node version by typing:

    nvm install 6.7.0
    
  3. If you wish to default one of the versions, you can type:

    nvm alias default 6.7.0
    
  4. Now you can also reference it by the alias like this:

    nvm use default
    
  5. Check now node version to verify whether changes are made or not by typing:

    node -v
    
2 of 2
9

If you only want to install tar.xz file from nodejs.org then follow below answer.

Try below links that might help you.

  1. Install NodeJS NPM on Linux

    if your downloaded NODE-LTS file is in *.tar.xz format, then replace:

    tar --strip-components 1 -xzf /usr/save/node-v4.2.1-linux-x64.tar.gz
    

    with

    tar --strip-components 1 -xf /usr/save/node-v4.2.1-linux-x64.tar.xz
    
  2. If the above method does not work, then follow this guide.


If these answers do not work, there is another way that works by using nvm. This method is specified in another answer.

🌐
npm
npmjs.com › package › node-tar.gz
node-tar.gz - npm
It's also possible to use tar.gz as a command line utility, you just need to install it globally with npm install -g tar.gz.
      » npm install node-tar.gz
    
Published   Aug 09, 2015
Version   1.0.0
🌐
Jason McCreary
jasonmccreary.me › articles › installing-node-js-npm-redis-mac-os-x
Installing Node.js, npm, and redis on Mac OS X
December 10, 2011 - 6curl http://nodejs.org/dist/node-v0.4.7.tar.gz | tar xz --strip-components=1 · 7./configure --prefix=~/local · 8make install · A few notes. First, this installs Node.js version 0.4.7. From what I read, this is currently the most compatible version. If you require a different version, I'll assume you know more about installing Node.js than me. Second, bash on Mac OS X uses .bash_profile not .bashrc.
🌐
Codegive
codegive.com › blog › node_js_tar_gz_install.php
Node.js tar.gz Install: Unlock Manual Control & Master Node.js Binaries (2024 Guide)
Unlike automated installations via apt-get, yum, brew, or nvm, this method gives you direct control over where the Node.js runtime and its associated tools (like npm) reside on your file system. The tar.gz format is a common Unix/Linux archiving and compression standard.
🌐
GitHub
github.com › nodejs › help › issues › 418
How do i install nodejs on Ubuntu 14.04 after downloading the package (.tar) from nodejs.org · Issue #418 · nodejs/help
December 23, 2016 - How do i install nodejs on Ubuntu 14.04 after downloading the package (.tar) from nodejs.org#418 · Copy link · Assignees · zenismaharjan · opened · on Dec 23, 2016 · Issue body actions · No description provided. gibfahn · No labels · No labels · No type ·
Author   zenismaharjan
🌐
Linux.org
linux.org › home › forums › general linux forums › ask tuxbot (archived)
help installing nodejs | Linux.org
February 15, 2024 - Sometimes I get caught up in the waves of information. Alright, let's get into it. First things first, installing Node.js and npm using tarballs can be a bit tricky. It's recommended to use a package manager instead, like apt, yum, or pacman, depending on your Linux distro.
🌐
Codegive
codegive.com › blog › install_node_js_from_tar_gz.php
Install Node.js from Tar.gz: Unlock Ultimate Control & Specific Versions (2024 Guide!)
To manually install Node.js from a tar.gz file, download the archive, extract it to your desired location, and then update your system's PATH environment variable to include the Node.js binary directory. This method provides granular control over versions and installation paths.
🌐
Linux Mint Forums
forums.linuxmint.com › board index › main edition support › software & applications
Need help installing Node.js (tar.xz) - Linux Mint Forums
December 29, 2021 - # Download. wget -q --show-progress 'https://nodejs.org/dist/v16.13.1/node-v16.13.1-linux-x64.tar.xz' # Extract. tar -xvf 'node-v16.13.1-linux-x64.tar.xz' # Execute. node-v16.13.1-linux-x64/bin/node You can create a shortcut if you want to run it more easily in future.
🌐
Medium
iamsaleempasha.medium.com › install-node-js-and-npm-on-linux-rhel-7-from-binaries-tar-file-248d0b0f305f
Install Node.js and NPM on Linux (RHEL 7) from Binaries / Tar File - Saleem Pasha - Medium
March 16, 2021 - Unzip and install under /usr/local folder cd /usr/local tar --strip-components 1 -xzf /home/user/download/node-v12.14.1-linux-x64.tar.gz