Amazon EC2 Tutorial : Hosting Mean Stack Application

Sunday, January 5, 2020

Amazon EC2 Tutorial : Hosting Mean Stack Application



Amazon EC2 is one of the most used and most basic services in Amazons so it makes sense to start with EC2 when you are new to AWS. But the first question is that what is EC2 in AWS ?


AMAZON EC2 HOSTING MEAN STACK APPLICATION
AMAZON EC2 HOSTING MEAN STACK APPLICATION


1. What is EC2 in AWS ?


Well to be very simple, 


  1. It's basically virtual machine which includes CPU, RAM, ROM e.t.c
  2. It also allows to choose different platform ( like windows, linux, ubuntu e.t.c ) while you are launching virtual machine in cloud. 
  3. The Virtual machine we called it as an instance, you can easily start, stop or terminate your instance.


2. AWS EC2 Mean Stack Application Screens?


I am sharing few screens about out Mean Stack Applications that we are going to host it in AWS EC2. 

Insert - 

Mean Stack Crud Application Insert
Mean Stack CRUD Application Insert

Update -

Mean Stack Crud Application Update
Mean Stack CRUD Application Update

Delete -

Mean Stack Crud Application Delete
Mean Stack CRUD Application Delete

3. Architecture of the Mean Stack Application

    In the below diagram, this is the architecture of our mean stack application that we are going to setting up in 2 AWS instance. In the FrontEnd Part I am using Angular 6, and

MEAN STACK APPLICATION ARCHITECTURE
MEAN STACK APPLICATION ARCHITECTURE

whatever user interaction got happened like create, read, write and delete it's happening from Node JS. So Node Js is act as a mediator which helps to talk to my database mongo DB and get back the data to frontend. So we will be going to use 2 instance 1 for frontend and 1 for backend.

Mean Stack FrontEnd Project Link - 

Mean Stack BackEnd Project Link -

If you want to learn more about Mean Stack please visit my blog - 

My youtube - Mean Stack Tutorial



About the AMAZON EC2 Tutorial also you can see - 



2. Installation of MongoDB into AWS EC2 Instance

First if you have not registered in AWS please register first. Then launch an UBUNTU instance. Download the pem key. Open your terminal - 

ssh -i yourkey.pem ubuntu@your_ec2_public_ip

Once you have logged in then follow the below process,

For Installation of MongoDB please visit the below link - 



More details -

You can also see my below videos - 


3. AWS EC2 Hosting Mean Stack Application using PM2 - 


This is the other ubuntu Instance that we are launching it. First thing we need to install Node JS, Angular 6, NVM and PM2 in the AWS EC2 instance. Then we have to clone the code inside the EC2 instance. 

Install Node JS - 

sudo apt update
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - sudo apt-get install -y nodejs 

Install NVM for changing the Node JS version -


nvm ls-remote 

Install Angular 6 -
sudo npm install -g @angular/cli@6.0.7

Mean Stack FrontEnd Project Link - 

Mean Stack BackEnd Project Link -
git clone https://atique12@bitbucket.org/atique12/mongocrud_application_back_end.git 

Then edit the file - 

Mean Stack BackEnd Project - db.js and index.js - Instead of Localhost put first instance mongo DB EC2 Public ip to db.js and 2nd instance public ip to 2nd EC2 instance.

Mean Stack FrontEnd Project - Inside src/app/shared

vi person.services.ts

Change localhost to 2nd AWS EC@ public ip.

You can also Visit my youtube video for more details - 





Thank you guyz.

Please don't forgot to subscribe my youtube channel.


6 comments :

markson said...

It is commonly confounded to plainly characterize explicitly what the best web facilitating truth be told is however there are a couple of rules it is not difficult to stay with that can assist you with discovering what the best web facilitating is https://onohosting.com/intended for your necessities.

priya said...

your content is very inspiring and appriciating I really like it please visit my site for Satta King Result also check Satta king 24X7 and also check sattaking and for quick result check my site Satta matka and for super fast result check Satta king

Singapore citizenship said...

This article provides good overview of motives of Singapore Workpass Application

Rosy S said...

great post with nice content and thanks for sharing!!
Demanding Skills
Why should I learn AWS?

5r739knnkf said...

At JackpotCity Punto Banco is the preferred variant and offers quick paced fun for everybody. If you play strategically and guess on the player's hand, the house edge is 1.36%. If you make a guess on the banker, the house edge is even lower and stands at 1.17%. Betting on a tie may not be not|will not be} so profitable though outcome of|as a outcome of} the house edge, in this case, can be as high 메리트카지노 as 14.4%, so the possibilities of winning when you guess on a tie are meagre.

bazcheusgd said...

The upside of this is that considered one of the} instruments are blocked behind a pay wall, so you'll be able to|you probably can} tweak your fashions to your heart’s want. In essence, Blender covers many facets of 3D creation, together with modeling, animation, and simulation amongst others. This open-source software program has a steep learning curve and is ideal for users who really feel able to transition to designing complicated 3D fashions. Some of them are pretty straightforward to make use of while different packages are solely suitable for Mens Boxers skilled users with years of experience. You can see the difference in the three Quickprint profiles in the above footage . A quick approach to spot the difference is by looking at the roof of the Benchy, the place the number of layers will increase with every bounce in high quality.