Deploying a Web Application using AWS EC2 and Application Load Balancer – Hands-on Project
Source: Dev.to
Project Overview
In this project, I created a simple web application and deployed it using AWS infrastructure. The application is served by multiple EC2 instances, and traffic is distributed using an Application Load Balancer (ALB). This setup ensures that if one server fails, the application continues to run smoothly through another server.
Architecture
User
↓
Application Load Balancer
↓
Target Group
↓
EC2 Instances running Nginx Web ServerThe Load Balancer distributes incoming requests across multiple EC2 instances to ensure better performance and high availability.
Technologies Used
- AWS EC2
- AWS Application Load Balancer
- AWS Target Groups
- Nginx Web Server
- HTML & CSS
- GitHub Pages
Step-by-Step Implementation
Launch EC2 Instances
Created two EC2 instances using the AWS Free Tier. Each instance was configured with Nginx via EC2 User Data so that the website is deployed automatically during launch.
Deploy Website on Instances
The website includes:
- Welcome page
- User login form
- Suggestion input field
- Project description section
Configure Target Group
Created a Target Group in AWS and registered the EC2 instances as targets, allowing the load balancer to monitor their health and distribute traffic.
Create Application Load Balancer
Set up an ALB to handle incoming traffic. The ALB forwards requests to the target group, which routes them to available EC2 instances, ensuring traffic distribution and improved reliability.
Configure Security Groups
Configured security groups to allow:
- HTTP traffic on port 80
- SSH access for instance management
GitHub Deployment
Uploaded the website code to GitHub and used GitHub Pages to host the static version.
- Live website:
- GitHub repository:
Key Learnings
- Launching and configuring EC2 instances
- How AWS Application Load Balancer distributes traffic
- Managing backend servers with Target Groups
- Deploying a static website using GitHub Pages
- Ensuring high availability with cloud infrastructure
Conclusion
This project provided practical experience in deploying a cloud‑based web application using AWS services. Understanding load balancing is an essential skill in modern cloud and DevOps environments, and even a simple architecture demonstrates the core principles of scalable and fault‑tolerant systems.