Deploying First Website on AWS EC2 (step by step guide)
In this blog, I’ll walk through how I deployed my first website on an EC2 instance using AWS. We will cover everything from launching an instance to connecting via SSH and hosting a static HTML pag...

Source: DEV Community
In this blog, I’ll walk through how I deployed my first website on an EC2 instance using AWS. We will cover everything from launching an instance to connecting via SSH and hosting a static HTML page using Nginx. Step 1: Create an AWS EC2 Instance Go to AWS Console → EC2 Dashboard Click on Launch Instance Configuration: Name: any-name AMI: Amazon Linux 2023 Instance Type: t2.micro or t3.micro (Free Tier) Key Pair: Create a new key pair Name : my-key-pair Download .pem file (very important) Step 2: Configure Security Group Allow the following: SSH (Port 22) → Anywhere (0.0.0.0/0) HTTP (Port 80) → Anywhere (0.0.0.0/0) Copy the public Ipv4 of your ec2 instance Step 3: Connect to EC2 via SSH (Windows) Open Command prompt and run: ssh -i my-key-pair.pem ec2-user@PUBLIC_IP_OF_EC2 Step 4: Update the Server sudo yum update -y Step 5: Install Nginx sudo dnf install nginx -y Start and enable Nginx: sudo systemctl start nginx sudo systemctl enable nginx Check status: sudo systemctl status nginx St