How to deploy NODE.JS application on Ubuntu 16.04/18.04


Hi Friends,

Today, we are going to deploy NodeJS sample application from GITHUB so you have a basic idea,

How can we deploy NodeJS application in Ubuntu 16.04/18.04


Requirement: 
Installation of NodeJS 
Installation of GIT (If not installed) 


GITHUB Sample application URL – https://github.com/contentful/the-example-app.nodejs
Step 1: Install the curl package 
[If not already installed]

sudo apt-get update
sudo apt-get install curl -y


Step 2: Add the NodeJS PPA for install the NodeJS
curl -sL https://deb.nodesource.com/setup_8.x | sudo bash -     
[PPA for Long Term Support (LTS) version]



Step 3: Install the NodeJS package
sudo apt-get install nodejs -y


Step 4: Clone the repository to root directory
sudo -i
git clone https://github.com/contentful/the-example-app.nodejs.git


Step 5: Now install the npm package from where package.json is –
cd the-example-app.nodejs
npm install




Step 6: Now finally run the NodeJS application

[this application will run on port 3000, make sure port allow on Firewall]
npm run start:dev



Now run the application on browser


Popular posts from this blog

WordPress Themes and Plugins Installation Problem

How to Convert PEM KeyFile into PPK KeyFile and vice versa?

How to SSH EC2 instance with ssh-agent along with SSH agent forwarding to SSH private instances in VPC?