Today we created a screencast on installing node.js under a ubuntu 10.04 virtual machine.  Here it is:

Installing Node.js and Testing Screencast from nodenode on Vimeo.

A couple of notes:

-As mentioned in the video if you are running ubuntu native, in a vm or on some other machine this will work the same.

-Some installation and compiling sections that took a few minutes were sped up to prevent long pauses in the video

-If you’re running windows grab virtual box and the ubuntu iso from the web set them up and follow along



The steps:

1. To install the tools needed to build node open a terminal and type the following commands:

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

2. Then checkout the node source:

    git clone git://github.com/ry/node.git

3. Change into the node directory the git clone made

    cd node

4. Configure the compiling process

    ./configure

5. Compile node.js:

    make

6. Install it:

    sudo make install

7. Set up a test directory:

    cd ..

    mkdir hello_node

    cd hello_node

8. Make a test server file (I used pico as my editor):

    pico hello_node.js

9. In the file enter the following (explained in the screencast):

    var http = require(‘http’);

    http.createServer(function(req,res){

      res.writeHead(200,{‘Content-Type’:’text/plain’});

      res.end(‘Hello this is node.js from nodenode.com\n’);

    }).listen(8000,”127.0.0.1”);

    console.log(‘Server running at http://127.0.0.1:8000’);

10. Using a web browser navigate to 127.0.0.1:8000 and you should see the working response