How to install Node.js on Debian 9

Node.js is an open-sourced Javascript platform that allows users the ability to quickly build network applications in a scalable manner. Node.js lets users employ JavaScript for server-side scripting. For the purpose of this article, we will be installing Node.js on a Debian machine using personal package archive (PPA). PPA will have more current versions of node.js available than are available in the standard Debian repository, and you can also explicitly select between Node.js versions to suit your needs.


To follow this guide, you’ll need access to the following:

  • A non-root user on your server that has sudo privileges enabled (if you’re following best practices, root logins to your Linux servers should be disabled)

Installing PPA and Node.js

Step 1

Let’s start by making sure that the Debian package installer, apt, has the most up-to-date information:

sudo apt update

Step 2

Next, install the curl tool if it is not already included with your system packages, then use it to download and install PPA. Notice that in this example we’re requesting “setup_13.x”, which means version 13.x is specifically being requested. You can replace “13.x” with any other desired version in the following commands:

sudo apt-get install curl
curl -sL | bash -

Step 3 

Now we can get to the install of Node.js. This command will also install NPM and any dependent packages needed for the install:

apt-get install -y nodejs

Step 4

Now that you have Node.js installed, you can check to make sure you have the versions you need installed with the following commands:

node -v
npm -v


Now that we have installed Node.js, we can move on to building a web server and start making applications. To see more specific information about PPA versions available for Node.js installations done this way, check out the NodeSource documentation page.

Leave a Reply

Your email address will not be published. Required fields are marked *