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.ioStart the node-js server. Just type:
~$ node chat.jsOpen the chat.html file in your favourite browser and enjoy!