Setup AWS with basic commands

Hardeep Singh
2 min readAug 11, 2020

FOR UBUNTU

# GIT Install

sudo apt install git

# System Update

sudo apt-get update

# npm (v6.14.6) node (v12.18.3) install

********** FOR OLD Version (node, npm) *********
** sudo apt-get install nodejs ////////////// gives old v6 **
** sudo apt-get install npm //////////////// gives old v3 **
*********** FOR OLD Version (node, npm)*********
sudo apt update
sudo apt -y upgrade
sudo apt update
sudo apt -y install curl dirmngr apt-transport-https lsb-release ca-certificates
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt -y install nodejs // gives old v12

i used these above command will provide npm (v6.14.6) node (v12.18.3)

# PM2 install & run

sudo npm install pm2@latest -g# to start PM2
sudo pm2 start npm --name <API NAME> -- run <SCRIPT NAME>

# nginx install & run

sudo apt-get install nginx
sudo ufw allow ‘Nginx HTTP’
sudo service nginx start
sudo service nginx restart

# mongoDB install & run

wget -qO — https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
sudo apt-get install gnupg
wget -qO — https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -

For ubuntu 18.04 (Bionic)

echo “deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse” | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.listsudo apt-get update
sudo apt-get install -y mongodb-org
sudo service mongod start

# SSL-certbot

https://certbot.eff.org/lets-encrypt/ubuntubionic-nginx

sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository universe
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install certbot python3-certbot-nginx
sudo certbot — nginx

Thank you.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Hardeep Singh
Hardeep Singh

Written by Hardeep Singh

Software Development Engineer 3 | ReactJs | NodeJs | ExpressJs | NextJs | MongoDB | Micro Frontend | Micro Services

No responses yet

Write a response