Deploying and Exposing a NodeJS Application to the External World with AWS EC2

๐ Hello! I'm passionate about DevOps and have over 1+ years of experience in the field. I'm proficient in a variety of cutting-edge technologies and always motivated to expand my knowledge and skills. Let's connect and grow together!
SKILLS:
๐น Languages & Runtimes: Python, Shell Scripting, HCL, YAML ๐น Cloud Technologies: AWS, Microsoft Azure, GCP ๐น Infrastructure Tools: Docker, Terraform, AWS CloudFormation ๐น Other Tools: Linux, Git and GitHub Actions, Jenkins, Jira, GitLab (beginner), Docker, AWS DevOps ๐น Web Development: HTML, CSS, Bootstrap, Python, SQL
Job & Responsibilities:
๐ Improved development efficiency by implementing CI/CD pipelines, resulting in a 30% reduction in deployment time on the test server. ๐ Strengthened deployment and testing reliability by utilizing Docker containers and optimizing Dockerfile, reducing development issues on the test server by 20%. โ๏ธ Automated S3 bucket log creation with Shell scripting, eliminating 100% of manual search and saving 2 hours per week. ๐ Scheduled EC2 instance start/stop using Lambda functions and Event Bridge, leading to a 25% decrease in infrastructure costs. ๐ง Utilized AWS, Linux, Python, Docker, Shell scripting, Terraform, Jenkins Pipelines, and automation to streamline workflows and improve overall system performance.
I'm very detail-oriented and possess strong written and verbal communication skills. As a high performer with a possibility mindset, I strive to solve problems using efficient approaches.
Let's Connect & Grow:
If you find my profile suitable for the role you are searching for, please feel free to reach out to me at sumanprasad9766@gmail.com.
๐ Introduction:
Hi Everyone, welcome to Day-12 of our learning series. In this session, we will cover how to deploy and expose a NodeJS application to the external world using AWS EC2. We will provide a live example and the source code is available on our GitHub repository.
๐น Session Content:
Creating an IAM User and Login: The first step is to create an IAM (Identity and Access Management) user and login to AWS. IAM allows you to manage users and their access to AWS services.
Creating an EC2 Instance: We will then cover how to create an EC2 instance. EC2 is a virtual server in the cloud and it is essential to have good practices when creating instances. We will discuss some of these practices.
Accessing the EC2 Instance: Once the instance is created, we will learn how to access it through the command line interface or a web browser.
Deploying an Application on AWS EC2: Next, we will cover how to deploy a NodeJS application on AWS EC2. We will provide step-by-step instructions and discuss best practices.
Exposing the Application to the Outside World: After deploying the application, we will demonstrate how to expose it to the outside world. This will allow users to access the application from anywhere with an internet connection.
Accessing the Application Deployed on AWS from Your Laptop: Finally, we will show you how to access the application deployed on AWS from your laptop.
๐นSummary:
In this session, we covered the process of deploying and exposing a NodeJS application to the external world using AWS EC2. We discussed the steps involved in creating an IAM user, creating an EC2 instance, accessing it, deploying an application, and exposing it to the outside world. We hope this session was helpful and informative for you. You can find the source code on our GitHub repository for further reference. Thank you for attending this session.
๐ Steps to follow along:
๐น Deploying a Node Js Application on AWS EC2
โTesting the project locally
- Clone this project
git clone https://github.com/verma-kunal/AWS-Session.git
- Setup the following environment variables -
(.env)file
DOMAIN= ""
PORT=3000
STATIC_DIR="./client"
PUBLISHABLE_KEY=""
SECRET_KEY=""
- Initialise and start the project
npm install
npm run start
โ Set up an AWS EC2 instance
Create an IAM user & login to your AWS Console
Access Type - Password
Permissions - Admin
Create an EC2 instance
Select an OS image - Ubuntu
Create a new key pair & download
.pemfileInstance type - t2.micro
Connecting to the instance using ssh
ssh -i instance.pem ubunutu@<IP_ADDRESS>
โ Configuring Ubuntu on remote VM
- Updating the outdated packages and dependencies
sudo apt update
Install Git - Guide by DigitalOcean
Configure Node.js and
npm- Guide by DigitalOcean
โ Deploying the project on AWS
- Clone this project in the remote VM
git clone https://github.com/verma-kunal/AWS-Session.git
- Setup the following environment variables -
(.env)file
DOMAIN= ""
PORT=3000
STATIC_DIR="./client"
PUBLISHABLE_KEY=""
SECRET_KEY=""
For this project, we'll have to set up an Elastic IP Address for our EC2 & that would be our
DOMAIN
- Initialise and start the project
npm install
npm run start
NOTE - We will have to edit the inbound rules in the security group of our EC2, in order to allow traffic from our particular port
๐ Resources:
Video Link by Abhishek Veermalla Sir: https://youtu.be/NLmF64KdLN0?list=PLdpzxOOAlwvIKMhk8WhzN1pYoJ1YU8Csa
GitHub by Kunal Verma + Readme file: https://github.com/verma-kunal/AWS-Session
Image Credit + Blog: https://sumantmishra.medium.com/how-to-deploy-node-js-app-on-aws-with-github-db99758294f1
โ Follow Prasad Suman Mohan for many such contents:




