# Setting Up Your First Node.js Application Step-by-Step

Let's Build a simple Hello worlds Node js server

## Step-1: Download and Install NodeJs

For install node js in Linux execute below given commands one by one...

```javascript
//Download and install nvm:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash

// in lieu of restarting the shell
\. "$HOME/.nvm/nvm.sh"

// Download and install Node.js:
nvm install 24

// Verify the Node.js version:
node -v 

// Verify npm version:
npm -v
```

## Step-2: Create Project Directory, File and initalize the project

```javascript
// For creating folder run this command in your terminal

mkdir <folder_name>

// for making file run below cammand

touch <filename>

npm init -y
```

## Step-3: Creating node js app

```javascript
// Importing required libraries
const http = require('http')

const server = http.createServer((req, res) => {
    res.end("Hello from node js")
})

PORT = 8000

server.listen(PORT, ()=>console.log(`Server is running on Port: ${PORT}`))
```

## Step-4: Run your app with the help of NodeJs

```javascript
// for running your app
node app.js

// yoy will see Server is running on port 8000 in your terminal
```

## Step-5: Check your server on localhost

```javascript
http://localhost:8000

// Output on browser should be "Hello from nodde js"
```

### That's all now you can add more features and apps on your project.
