AWS EC2 Portfolio Hosting

Dynamic Hosting with CI/CD and Server Management

📖 Project Overview

This project demonstrates the deployment of my personal portfolio website on an AWS EC2 instance. Unlike static hosting with S3, EC2 allowed me to configure a full web server using Nginx, practice server management, and implement a CI/CD pipeline with AWS CodePipeline. This setup provided hands-on experience in infrastructure provisioning, hosting both dynamic and static files, and automating deployments for a seamless workflow.

Technologies & Services Used

  • AWS EC2 (Ubuntu t2.micro)
  • Nginx
  • AWS CodePipeline
  • AWS CodeDeploy
  • IAM Roles
  • Namecheap
  • Cloudflare
  • HTML
  • CSS
  • JavaScript

🚀 Setup Steps

  1. Create an Ubuntu t2.micro EC2 instance (free tier).
  2. Connect via SSH and configure Nginx to serve files from /var/www/html/.
  3. Test the site using the EC2 public IP.
  4. Push code to a GitHub repository.
  5. Set up CodePipeline with GitHub as the source and CodeDeploy for deployment to EC2.
  6. Configure Cloudflare DNS with an A record pointing to the EC2 public IP.
  7. Enable Cloudflare SSL for secure HTTPS access.

âš¡ Challenges & Solutions

Manual Deployment Delays

Uploading files to EC2 manually via SSH was time-consuming.

✅ Solution: Implemented CodePipeline and CodeDeploy for automated deployments.

Complex SSL Configuration

Setting up HTTPS on EC2 with Let’s Encrypt required manual certificate renewals.

✅ Solution: Utilized Cloudflare’s free SSL for simplified management.

DNS Propagation Issues

Cloudflare DNS updates took hours to propagate globally.

✅ Solution: Verified DNS settings with tools like dig and nslookup, then allowed time for propagation.

🎯 Key Takeaways

  • EC2 hosting provided full server control, enabling advanced configurations compared to S3.
  • Mastered Linux server management, Nginx setup, and deployment troubleshooting.
  • Developed expertise in CI/CD pipelines, IAM roles, and domain/SSL integration.
  • Cloudflare proved to be a cost-effective alternative to Route 53, offering free SSL and caching.

📸 Gallery

EC2 Setup

EC2 Instance Setup

Nginx Configuration

Nginx Configuration

CodePipeline Setup

CodePipeline Setup

Live Portfolio

Live Portfolio