AWS EC2 Deployment

Deploy a production-ready website on AWS EC2 using DevOps best practices.

AWS EC2 (Elastic Compute Cloud) allows you to run virtual servers in the cloud. In this guide, we’ll deploy a live website on EC2 using secure, scalable and production-friendly steps.

1. Launch an EC2 Instance

Login to AWS Console → EC2 → Launch Instance. Choose Ubuntu or Amazon Linux as the operating system.

2. Configure Security Groups

3. Connect to EC2 via SSH

ssh -i key.pem ubuntu@EC2_PUBLIC_IP

4. Install Web Server (Nginx)


sudo apt update
sudo apt install nginx -y
      

5. Deploy Website Files

Upload your project files to:

/var/www/html

6. Domain & SSL Setup

Point your domain to EC2 public IP and use Certbot to enable HTTPS.

Best Practices