setting up prod env in ubuntu

setting up prod environment in ubuntu

Install Nginx

commands –

sudo wget
sudo nano /etc/apt/sources.list

# add
deb trusty nginx
deb-src trusty nginx

sudo apt-get update
sudo apt-get install nginx
sudo service nginx start

Install node js

commands –

cd ~
curl -sL -o
sudo bash
sudo apt-get install nodejs
sudo apt-get install build-essential

Install pm2

sudo npm install pm2@latest -g
pm2 startup
sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u ubuntu --hp /home/ubuntu

Run the code

git http://{user-name}:{password}{xxx}.git
npm install
NODE_ENV=prod pm2 start app.js --name api-prod

Ready to restart

pm2 save

About sunnyparkash
A Technoalcholic

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: