FREE TRIAL

Free VPS Trial

Start Free Trial
  • Live Chat
  • +357 2425 0808
  • Login
How To Install Node.js and NPM on Debian 11 server

How To Install Node.js and NPM on Debian 11 server

NetShop ISP

NetShop ISP · Blog Author

Nov 27, 2022 · Tutorials

Node.js is an open-source JavaScript library built on Chrome’s V8 engine and is primarily used for back-end API services and other server-side applications. Along with React, Node.js is one of the most popular technologies in the world of front-end web development in 2022.

In this tutorial, we will demonstrate two easy ways to to install Node.js and NPM on a Debian 11 server. For the purpose of this writing this tutorial, we have used and tested all commands in a VPS server running Debian 11 64-bit.

Tutorial Pre-requisites

  • Linux machine running Debian 11 OS
  • Root access (or alternative user with root/sudo privileges)

2 Easy Ways To Install Node.js and NPM on Debian 11 Server

First connect via SSH on your server, and ensure all Debian packages are up-to-date. You can do so by executing the following commands:

root@netshopisp-vps:~# apt update && apt upgrade -y

Now that our Debian 11 environment is fully up to date we can proceed to installing Node.js and NPM. We will demonstrate three different, easy ways.

Method 1: Install Node.js and NPM via Debian Repository

The following command will install both packages at once. This is the simplest and most reliable way.

Note that at the time of writing this tutorial (November 2022), Node.js version 12.22 is included by default on Debian’s repositories.

root@netshopisp-vps:~# apt install nodejs npm

As soon as both packages are installed, you can verify their version by executing the following commands:

root@netshopisp-vps:~# node -v
root@netshopisp-vps:~# npm -v

Sample Output:

NodeJS and NPM installation from Debian Repositories – Check versions

Method 2: Install Node.js and npm from NodeSource

The second method requires a bit more effort than the first, however in case you want to install a specific version of NodeJS and/or NPM, then this method is preferred.

NodeSource maintains an APT repository with multiple Node.js versions.

First command will install ‘curl’ in our system:

root@netshopisp-vps:~# apt install curl -y

We are going to download and run the Node.js installation script for version 16.
If you want another version of Node.js  (for example 14.x) just change the setup_16.x with setup_14.x.

root@netshopisp-vps:~$ curl -sL https://deb.nodesource.com/setup_16.x | bash -

Now, install the Node.js version 16 with the following command:

root@netshopisp-vps:~# apt install nodejs

The Node.js package contains both the node and npm binaries. Once installed, verify the installed version of Node.js with the same commands as mentioned earlier in this tutorial.

root@netshopisp-vps:~# node -v
root@netshopisp-vps:~# npm -v

Sample Output:

Manual Installation of NodeJS and NM from NodeSource – Check versions

Congratulations! You have now installed Node.JS and NPM on your Debian 11 server. Both two methods we demonstrated are easy and fast to install.

Categories

Backup
6
Business Continuity
4
Cloud Hosting
9
Colocation
4
Company Updates
1
Cryptocurrencies
1
Data Centers
12
Dedicated Servers
4
Disaster Recovery
3
Forex
24
Gaming
1
iGaming
33
Industry News
31
Interviews
10
Joomla
9
Magento
5
Managed Services
1
Operating Systems
1
Press Releases
60
Product News
6
Resellers
1
Security
24
Software & Apps
1
Streaming
1
Tech Startups
12
Tutorials
56
Uncategorized
389
Vps Hosting
11
Web Design & Development
3
Web Hosting
43
Webinars
1
Wordpress
14

Free VPS Trial

No Credit Card Required.

Recent Posts

Reflecting on a Year of Growth and Big Investment [CEO Interview at SBC Leaders Magazine]

Reflecting on a Year of Growth and Big Investment [CEO Interview at SBC Leaders Magazine]

25 January, 2023

How To Remove SSH Keys from Linux Server

How To Remove SSH Keys from Linux Server

16 January, 2023

How To Install Language Pack on Windows Server 2019

How To Install Language Pack on Windows Server 2019

30 December, 2022

Ultimate Fintech Awards 2023: NetShop ISP Shortlisted for “Best Connectivity Provider – MEA” Award

Ultimate Fintech Awards 2023: NetShop ISP Shortlisted for “Best Connectivity Provider – MEA” Award

29 December, 2022

Updated Version of myNetShop Client Portal Released: What’s New

Updated Version of myNetShop Client Portal Released: What’s New

27 December, 2022

Products

Bare Metal Dedicated Servers

Virtual Servers (VPS / VDS)

Rack Space & Colocation Hosting

Fast Web Hosting

Cloud Backup

Premium DNS Hosting

Resources

Blog

Videos

Events

APIConnect

WhitepapersNew

Looking Glass

Company

About Us

CareersNew

Awards & Honours

Become a hosting Partner of NetShop ISP

Contact Us

#letushostyou

Award Winning Hosting Provider with a Customer-centric approach to Business and an Open Source Mindset regarding Solutions and Products Development.

Est. 2004, Larnaca – Cyprus


About

Legal Address: 2A, Marathonos, Livadhia, 7060, Cyprus

Operations Office: 120, Faneromenis Avenue, Imperial Tower, 2nd Floor, Larnaca, 6031, Cyprus

Company Reg: HE 217340
EU VAT Number: CY10217340J
ISO 9001:2015: No. QS.21.038

International Phone: +357 2425 0808