Setup AWS with basic commands

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.

--

--

--

Founder and C.E.O at XpRate.com | Want to help world to grow 🌱

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Better Apps By Default

//platform.twitter.com/widgets.js from Twitter https://twitter.com/envus_motors

JavaScript in PayPal

Building a Shopify Vue.js Theme from Scratch

Implementing bubble sort in Javascript

How to Add Relations to Your GraphQL Schema

VoxEdit Beta Update #6— Released!

How To Add Advanced Controls to a Table Using DataTables

DataTables Logo

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Hardeep Singh

Hardeep Singh

Founder and C.E.O at XpRate.com | Want to help world to grow 🌱

More from Medium

Transfer data to AWS EC2 instance using FileZilla

Install MongoDB on EC2 Instance — Solved Connection Issue From Public DNS — ScanSkill

Creating A DynamoDB Table using AWS CLI 101

Import large MySQL DB into AWS RDS