28.9 C
Senior Writer and partner

How to install NodeJS on Debian 11?

Hello dear friends. NodeJS technology is one of the most used technologies on the internet. Besides this, it is the basis of many interesting applications that exist. So, in this post, you will learn how to install NodeJS on Debian 11. For this, we will show you two different methods.

NodeJS is a technology that allows running Javascript on the server-side using Google’s V8 engine. It is a real revolution in the way web applications are developed because it reduces the asymmetry of client and server performance.

Many important forms such as Linkedin or eBay were created using this technology. This shows us the power of NodeJS.

An advantage of NodeJS is that its syntax is similar to that of Javascript and therefore its learning curve decreases a lot.

Install NodeJS on Debian 11 – First method

- Advertisement -

As NodeJS is widely supported on Linux, it is common to find it in the official repositories of almost any distribution. In this case, it is also available from the official Debian 11 repositories so the installation becomes easier.

So, open a terminal emulator or connect via SSH to Debian 11 and update it first:

sudo apt update
sudo apt upgrade

Now, you can install NodeJS as follows

sudo apt install nodejs

This way, you will be shown many of the dependencies to install. Although there are a lot of them, the reality is that the installation will be very fast.

When finished, you can check the installed version with the command:

node --version

This is the fastest and safest way to install NodeJS, but it is not the only one, nor is it necessarily the best.

Getting recent versions of NodeJS on Debian 11

By adding an external repository, it is possible to install a recent version of NodeJS. At the time of writing this post, the 14.x branch is the LTS branch, i.e. the one recommended for production environments, and the 16.x branch is the most recent one. We can install them in both cases.

So, if you already have NodeJS installed, uninstall it as follows:

sudo apt remove nodejs

And to install the LTS series (currently 14.x) run these commands:

curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo bash -
sudo apt install nodejs

But if you want to install the latest version of NodeJS which is currently 16.7.0 then run these commands:

curl -fsSL https://deb.nodesource.com/setup_current.x | sudo bash -
sudo apt install nodejs

In any case, you can choose the one you like the most, and when finishing check the version installed with the command

node --version

This way NodeJS will be installed on your system and ready for whatever you need.

Enjoy it.


NodeJS is a cutting-edge technology for the development of web applications. In this post, you have learned two different ways to install it on Debian 11

Please share this post with your friends and join our Telegram channel.

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
"The best Linux newsletter on the web"


Please enter your comment!
Please enter your name here

Latest article