NEW LOCATION

Olá Brazil Brazil NVMe-powered VPS Plans in Brazil Now Available.

Deploy Instantly
  • +357 2425 0808
  • Login
  • English

Home

Blog

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

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 · Technical 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.

Press Releases
79

Free VPS Trial

No Credit Card Required.

Recent Posts

Black Friday & Cyber Monday Offer – 30% Lifetime Discount on VPS Plans

Black Friday & Cyber Monday Offer – 30% Lifetime Discount on VPS Plans

02 December, 2024

How To Install Sendy on Ubuntu 22.04 Server

How To Install Sendy on Ubuntu 22.04 Server

27 November, 2024

How To Extract Certificates and Private Key from .PFX file

How To Extract Certificates and Private Key from .PFX file

19 November, 2024

NetShop ISP CEO Stefano Sordini to Moderate Key Panel on Forex AI Automation at Cyprus Fintech Summit 2024

NetShop ISP CEO Stefano Sordini to Moderate Key Panel on Forex AI Automation at Cyprus Fintech Summit 2024

15 November, 2024

Preparing for the Daylight Saving Time (DST) Change: Essential Updates for MetaTrader 4/5 Platforms

Preparing for the Daylight Saving Time (DST) Change: Essential Updates for MetaTrader 4/5 Platforms

25 October, 2024

#letushostyou

Award Winning Hosting Provider established in 2004.

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

Products

Bare Metal Servers

Customized Servers

Virtual / Cloud Servers

Forex VPS

Storage VPS

cPanel Web Hosting

Reseller Web Hosting

Colocation

Addons

Premium DNS

Email Hosting

Cloud Backup

DDoS Protection

Licenses

SSL Certificates

Domain Names

Premium SLAs

About Us

Data Center Locations

Looking Glass

Our Company

Contact Us

Careers in Cyprus

Become a Partner

Awards

Certifications

© 2024 S.S. NetShop Internet Services Ltd. All rights reserved.  Terms & Conditions  |  Privacy Policy
CY Reg. Number: HE 217340 | EU VAT Number: CY10217340J

Visa
Mastercard
PayPal
Bitcoin
Tether
Ethereum
Litecoin
Wise
Revolut
Wire Transfer