This project demonstrates how to deploy a secure static website on an AWS EC2 instance using the Nginx web server and HTTPS encryption.
The goal of this project is to practice fundamental DevOps and cloud engineering skills including:
- Launching an EC2 instance
- Connecting securely using SSH
- Installing and configuring Nginx
- Deploying a static website
- Securing the website with HTTPS
- Managing a Linux server in the cloud
- AWS EC2 – cloud compute infrastructure
- Ubuntu Linux – server operating system
- Nginx – web server used to host the static website
- SSH – secure remote server access
- Let's Encrypt (Certbot) – SSL certificate for HTTPS encryption
-
Launch an EC2 instance in AWS
-
Connect to the server securely using SSH
ssh -i your-key.pem ubuntu@your-ec2-public-ip- Update the server packages
sudo apt update
sudo apt upgrade -y- Install Nginx web server
sudo apt install nginx -y- Start and enable Nginx
sudo systemctl start nginx
sudo systemctl enable nginx- Verify Nginx is running
sudo systemctl status nginx- Deploy the static website files
cd /var/www/html
sudo rm index.nginx-debian.html
sudo nano index.html- Install Certbot for HTTPS
sudo apt install certbot python3-certbot-nginx -y- Configure SSL certificate using Let's Encrypt
sudo certbot --nginx- Verify HTTPS certificate renewal
sudo certbot renew --dry-run- Access the website from a browser
Open your browser and visit:
http://your-ec2-public-ip
or
https://your-domain-name
After deployment, the website should be accessible from a browser using the EC2 public IP address or the configured domain name.
The infrastructure was deployed inside a custom AWS VPC network.
VPC CIDR:
10.0.0.0/16
Subnets created:
- Frontend Subnet: 10.0.0.0/24 (EC2 Web Server)
- Backend Subnet: 10.0.1.0/24
- Database Subnet: 10.0.2.0/24
The EC2 instance hosting the website resides in the frontend subnet and is accessed through an Internet Gateway.
During this project I learned how to:
- Design a VPC with multiple subnets
- Launch and configure EC2 instances
- Install and configure Nginx on Ubuntu
- Secure web traffic using HTTPS with Let's Encrypt
- Configure Security Groups to restrict SSH access
- Document infrastructure and architecture for reproducibility
To avoid unnecessary AWS charges, the EC2 infrastructure used in this project was terminated after successful deployment and testing.



