Installing node.js on ubuntu 10.04

With all the euphoria about node.js since the last few months, I finally decided to give it a try. As it is not available for Windows, I decided to install it on Linux instead of going for Windows/Cygwin. node.js is a implementation of CommonJS, a JavaScript ecosystem in development to be used for developing application outside the browser, like:

- Server-side JavaScript applications
- Command line tools
- Desktop GUI-based applications

Installing node.js

As mine was a clean Ubuntu installation, I needed to install certain libraries first.

sudo apt-get install g++ curl libssl-dev apache2-utils

The easiest way is to download node.js is to get a git clone. For that I needed to install the git package.

sudo apt-get install git-core

Now download node.js with git.

git clone git://

If you do not want to use git you could get the tar package instead.

gunzip node-v0.1.96.tar.gz
tar -xf node-v0.1.96.tar

Now you are ready to install node.js.

cd node
sudo make install

Example node.js code

Below is a simple program using node.js for translating text using google API.

var http = require('http');
var url = ('')
var google = http.createClient(80, url);
var text = "Hello World from node!";
var requestUrl = '/ajax/services/language/translate?v=1.0&q=' + 
                 escape(text) + '&langpair=en%7Cfr'
var request = google.request('GET', requestUrl, 
              {"host": ""});
request.addListener('response', function (response) {
  	var body = '';
	response.addListener('data', function (chunk) {
		body += chunk;
    response.addListener("end", function() {
        var jsonData = JSON.parse(body);

This simple example does not to justice to the true power of node.js. I’ll be posting useful examples in the near future. Keep watching.

This site is a digital habitat of Sameer Borate, a freelance web developer working in PHP, MySQL and WordPress. I also provide web scraping services, website design and development and integration of various Open Source API's. Contact me at metapix[at] for any new project requirements and price quotes.

26 Responses



July 13th, 2010 at 12:36 am

simple tutorial, this is what i need..


Brando Bandit

August 12th, 2010 at 3:51 am

Thanks for this man! I will try this one…


Jerome Etienne

August 20th, 2010 at 2:56 am

There is a simpler way to install. nodejs deb package is availble on ubuntu repository.

just copy this single line in a terminal

sudo add-apt-repository ppa:jerome-etienne/neoip && sudo apt-get update && sudo apt-get install nodejs

4 » Blog Archive » Node.js, Faye, Apache Proxies, Nginx and Websockets [WTF]

August 26th, 2010 at 5:11 pm

[...] 1.A: Get Node.js installed. Step 1.B: Get nginx installed. “sudo apt install [...]


Kevin Whinnery

October 24th, 2010 at 12:51 pm

Right on man, this worked for me right out of the box on my fresh ubuntu install. Thanks for sharing…


getting started with Node.js « Erik's blog

November 22nd, 2010 at 12:52 pm

[...] found what appears to be a nice tutorial for installing Node on Ubuntu 10.4, so I’ll start with [...]


Mike Comstock » Trying out Node.js with EC2

December 13th, 2010 at 11:59 pm

[...] Installing node.js on ubuntu 10.04 by Sameer Borate [...]


Steve Midgley

December 23rd, 2010 at 10:58 am

Perfect bootstrap article! Thank you. Got me started..



December 26th, 2010 at 1:59 pm

very nice ans simple tuts



December 26th, 2010 at 4:15 pm

Thank you for this great, simple tutorial!


Sam Dutton

January 4th, 2011 at 4:03 am

Many thanks – well written, clear and complete.

The following site also has a useful tutorial for getting started with node.js:


Thai Bui

January 7th, 2011 at 11:16 pm

Very nice. I got up and running in no time. I can’t wait to see what else you’ll publish with node.js. Thank you!


Ganesh Kumar

February 25th, 2011 at 7:40 am

Good One… Thanks a lot



April 29th, 2011 at 1:36 pm

$ git clone git://
Cloning into node…
fatal: remote error:
Could not find Repository ry/node



May 2nd, 2011 at 8:32 am

Update : The node.js source files are now located at



May 14th, 2011 at 1:40 pm

thanks to your tutorial brader.



May 15th, 2011 at 11:06 am

Beside the new repo location, it’s also likely you will want a more stable version, rather than the latest. At the root of the repo, after cloning and before building:

git checkout v0.4.7

(v0.4.7 as an example)


New language to the toolset: NodeJS - Refactored scope

May 16th, 2011 at 2:35 pm

[...] the meantime as I use Ubuntu for everything but games, this short article here ( ) was enough to get a working [...]


Amar D Guru

May 30th, 2011 at 6:58 am

Thanks for the straightforward and accurate instructions to get started with node.


Sachin Pethani { Web-Farmer }

June 4th, 2011 at 8:23 am

Hi folks,

I’m so excited to taste the node… And i found this articles very useful to install the node on Ubuntu.

Keep writing great node tutorials….

Many thanks,



June 20th, 2011 at 3:28 pm

If you are installing on a bare system then you would have to install build-essential aswell.

apt-get install build-essential


Dan Beam

November 30th, 2011 at 1:10 pm

I just created something similar to this article but in a small script. It can be used to update node.js at any time (compares local to remote versions).

You can also curl the raw version and pipe it to bash, i.e.

curl -s | bash

if you trust the script to execute on your box.


Installing the chat example on node.js + using git and npm | Does not compute.

August 16th, 2012 at 3:05 am

[...] node.js and We had a heck of a time getting it up and running, even having referenced installation articles and google groups about the matter, so I’m posting my findings [...]


Simon H

December 9th, 2012 at 8:06 am

Perfect, thanks for that :)


How to Install Node.js | Open source Softwares, Tutorials, Question and Answers, Technology news, Gadget reviews and Mobile Apps

May 9th, 2013 at 10:07 am

[...] to code-diesel for the Ubuntu [...]


An Introduction to Node.js

August 25th, 2014 at 5:28 am

[...] to code-diesel for the Ubuntu dependencies. Windows Currently, you must use cygwin to install node. To do so, [...]

Your thoughts

Sign up for fresh content in your email