MEAN stack environment on the AWS EC2 instance server for free

May 22, 2020 0 comments
Before we start, we have to make sure that AWS account is created. If you don't have AWS account then please create an account with AWS.  By default All new AWS users are placed in the free usage tier. AWS free tire grants, among other features, 750 hrs/month of free Amazon EC2 micro access .  While creating an account, be sure to choose the Basic (Free) option.

After this click on Sign into Console and login using your credentials, after login go to AWS Management Console  & as shown in image Click on EC2

Mean stack environment on the AWS EC2 instance


On click of EC2, you will be landed on Dashboard. check following image for same. To create Bitnami Mean Instance on EC2 Free Tier on AWS, click on Launch Instance

Launch MEAN stack instance on EC2


On click of Launch Instance, you will be redirected to Choose An Amazon Machine Image (AMI), at this point search for "BITNAMI MEAN"

Mean Certified by Bitnam
After search click on AWS Marketplace, select Mean Certified by Bitnami

Select Mean Certified by Bitnam on Aws
 

On click of select,  you will see screen mentioning following details
  • MEAN Certified by Bitnami: MEAN gives you the abilty to start building dynamic web applications by providing a complete framework to write your app code. This image is configured for production environments. It includes SSL auto-configuration with Let's Encrypt certificates, and the latest releases of Javascript components: MongoDB, Express, Angular, and Node.js. It ..
Highlights
  • Ready to run JavaScript software stack consisting of MongoDB, Express, Angular, and Node.js. It includes everything necessary to build modern, scalable web applications. Just launch the Bitnami MEAN Stack in the cloud and add your code in minutes.
  • In addition to the core components, the stack also includes an Apache web server, PHP, RockMongo, and Git.
  • This image is regularly updated with the latest stable release of each component.
Mean Certified by Bitnam Free tire


On click of continue- choose an Instance Type

Mean Certified by Bitnam Choose Instance type


On final of Review and Launch  you will be redirected to Review screen. This is final screen to create MEAN stack environment on the AWS EC2 instance server for free.

Mean Certified by Bitnam Launch

Now we shall get a screen to download Key, this key we will be using to connect to our MEAN stack EC2 instance. Here we shall generate new key pair.

Key Pair creation for SSH login

Here select Create a new key pair, and give name to the key, and Download Key Pair

Download SSH Key pair for MEAN stack enviornment

After downloading Key Pair, Launch Instances button will be Enabled. Then click on Launch Instance. Now we can see our instance running in Console

Now we have successfully created MEAN stack Bitnami instance on the AWS EC2 server for free. 



Connecting to MEAN stack Bitnami instance on AWS EC2 server

This is important step, please read carefully, As Bitnami MEAN installation is pre-configured with Mongo Admin and Password, we need to get Root user password from System Log. This password is set only once.

To obtain our Mongo Root user password, right click on the row of Mean EC2 instance and navigate to Instance Settings > Get System Log
Get mongo user root password

Scroll through the system log, till you see a box with word : 

Setting bitnami application password to 

This is your initial mongo db password, copy it and keep it safe, Do not lose the password, You will only be shown it Once!!!  You will need this password in order to get access to your Mongo DB

Mongo db password
 

Connect MEAN Bitnami AWS EC2 instance using SSH

To connect our MEAN EC2 instance using SSH, we are going to use PUTTY .
Once we are done in installing Putty, lets get back to Aws dashboard, click on our running instance. Check in Description tab, there is Public DNS (IPv4); this represent the Url where our application will sit and the hostname we will be connecting to.

MEAN stack on AWS EC2 IP Address


to check if server is working, simply copy paste this in browser, and browser should display default landing page of BITNAMI.

MEAN Stack AWS EC2 instance Launched Successfully


we will be using this Host Name along with the .pem security key we downloaded earlier to connect to your EC2 instance.


But before we can proceed with our connection, we need to convert your .pem file into a .ppk file that PuTTY can recognize. For this you will need the program PuTTYgen. Download and install PuTTY.  After download simply run PuTTYgen

PuTTYgen - MEAN stack AWS EC2 instance


Once we start PuTTYgen load downloaded .pem file, make sure you switch the file types to "All files" when browsing for your key. Once its loaded, click “Save Private Key” and re-save your file as a PuTTY Private Key file (.ppk).

MEAN AWS EC2 Instance Putty Gen SSH Key

Now lets connect to our server using Putty, open Putty, Add our DNS IP from AWS console, we discussed earlier in this article.

Add our SSH key in Auth, check following images for better understanding.

Put IP Address of MEAN Stack AWS EC2 in Putty

MEAN Stack AWS EC2 - Key selection in Putty

Now click on open, this will connect us to Our MEAN stack AWS EC2 instance, default user name is bitnami.
MEAN Stack connect using PUTTY


Now we have successfully create AWS EC2 MEAN instance and connected to it using SSH.