Node.js installation and configuration for beginners

Hello Friends, In this tutorial we are going to learn about installation and configuration of node.js in our system.

This will be your first “Hello World”  program using node.js.

How to install node.js on ubuntu

I have linux(ubuntu) machine so i ran this command to install node.js in my system

$ sudo apt-get update
$ sudo apt-get install -y nodejs

After installation check node.js installed successfully or not by this command

$ nodejs -v

It’ll display currently installed node version.

If you have window’s machine then you can directly  download node.js exe  and run.

Now time to create your first hello world  program.
create file name app.js in your helloworld directory.


var http = require('http');

var server = http.createServer(function (request, response) {
  response.writeHead(200, {"Content-Type": "text/plain"});
  response.end("Welcome in Hello World");


console.log("Server running at");

And run below command on your terminal to execute your  program and see output on browser and terminal.

$ nodejs app.js


Hope this tutorial will help you to create your first hello world  program in nodejs. 🙂

If you like this post please don’t forget to subscribe My Public Notebook for more useful stuff.