To Install node-js just follow this guide https://github.com/joyent/node/wiki/Installation.
Then you need to Install the Node Pacakge Manager (NPM). Read this guide https://github.com/isaacs/npm.
Get socket.io via NPM by running:
~$ npm install socket.io
Start the node-js server. Just type:
~$ node chat.js
Open the chat.html file in your favourite browser and enjoy!