1. Log in to AWS Management Console
- Go to: AWS EC2 Console
- Sign in with your AWS account.
2. Launch an EC2 Instance
- From the Services menu → Select EC2.
- Click Launch Instance.
- Give your instance a name (e.g.,
MyServer).
3. Choose an Amazon Machine Image (AMI)
Select an OS (commonly used options):
- Amazon Linux 2 (Free tier eligible)
- Ubuntu Server (20.04/22.04)
- Windows Server (if required)
4. Choose Instance Type
-
Free tier:
t2.micro(1 vCPU, 1GB RAM) - For larger workloads:
t3.medium,m5.large, etc.
5. Configure Key Pair (for SSH login)
- Under Key pair (login) → Create new key pair.
- Choose RSA and
.pemformat. - Download the
.pemfile → Keep it safe (required for SSH).
6. Configure Network Settings
- In Network settings:
- Ensure VPC and Subnet are selected (default works).
- Enable Auto-assign Public IP.
- Add Security group rules:
- ✅ SSH (22) → For Linux (your IP only).
- ✅ RDP (3389) → For Windows.
- ✅ HTTP (80) → For web traffic.
- ✅ HTTPS (443) → For SSL traffic.
7. Launch Instance
- Click Launch Instance → AWS will provision your server.
8. Connect to Your Server
🔹 For Linux (using terminal)
chmod 400 my-key.pem # Set correct permission
ssh -i "my-key.pem" ec2-user@<Public-IP>
🔹 For Ubuntu AMI
ssh -i "my-key.pem" ubuntu@<Public-IP>
🔹 For Windows
- Download RDP file from Connect → RDP client.
- Use Administrator password (decrypt using
.pemfile).
9. Install Required Software
Example: Install Nginx on Linux
sudo yum update -y
sudo yum install nginx -y
sudo systemctl start nginx
sudo systemctl enable nginx
- Open browser →
http://<Public-IP>
10. (Optional) Elastic IP
- Prevents IP from changing after restart:
- EC2 Console → Elastic IPs → Allocate → Associate with instance.
✅ Your EC2 server is now ready!
Top comments (0)