Installing Node.js and NPM on Ubuntu/Debian

• tagged linux, ubuntu, debian, devops, node, nodejs and npm • 122 words • ~1 minutes

This is just short snippet on how to install Node.js (any version) and NPM (Node Package Manager) on your Ubuntu/Debian system.

Step 1 - Update your system

sudo apt-get update
sudo apt-get install git-core curl build-essential openssl libssl-dev

Step 2 - Install Node.js

First, clone the Node.js repository:

git clone
cd node

Now, if you require a specific version of Node:

git tag # Gives you a list of released versions
git checkout v0.4.12

Then compile and install Node like this:

sudo make install

Then, check if node was installed correctly:

node -v

** Step 3 - Install NPM**

Simply run the NPM install script:

curl | sudo sh

And then check it works:

npm -v

That’s all.


Hey! I'm a software engineer building rock solid back-end systems using Ruby, Ruby on Rails and Golang. In my free time I like to play the piano and experiment with electronics.

I'd love to hear your questions and comments on this article: just mention me on twitter or dispatch an email. Cheers!