Day 5: EC2 Basics — Launch Your First Cloud Server
Goal: Understand what EC2 is and launch your first virtual machine (server) using AWS EC2.
🖥️ What is EC2?
EC2 stands for Elastic Compute Cloud.
It lets you run virtual machines (VMs) in the cloud — just like a regular computer but on AWS.
🧠 Imagine:
“You rent a computer from AWS, and you can use it anytime, anywhere — no physical hardware needed.”
🔑 Why Use EC2?
- Host websites or apps
- Run scripts or software
- Store data or run databases
- Learn Linux or Windows server usage
💡 EC2 Basics in Simple Terms
Term | What It Means |
---|---|
Instance | A virtual computer (server) you launch |
AMI | Pre-built software image (e.g., Linux, Windows) |
Instance Type | Defines how powerful your server is (CPU, RAM) |
Key Pair | A password file to access your server |
Security Group | Like a firewall; controls who can access your instance |
Elastic IP | A permanent IP address you can attach to your server |
🛠️ Step-by-Step: Launch Your First EC2 Instance
- Go to AWS Console → Search for
EC2
→ Click the first result - In the left menu, click “Instances”, then click “Launch Instances”
- Name your instance (e.g.,
my-first-ec2
) - Choose AMI (Operating System):
- Select Amazon Linux 2023 (free tier eligible)
- You can also choose Ubuntu or Windows, but Linux is simple for now.
- Instance type:
- Select t2.micro or t3.micro (these are free tier eligible)
- Key Pair:
- If you don’t have one, create a new key pair
- Choose
.pem
and download it (keep it safe — you’ll use it to connect later)
- Network Settings:
- Allow SSH (port 22) so you can connect via terminal
- For now, allow from My IP (for safety)
- Click Launch Instance
🎉 Congratulations — your first cloud server is now running!
🔗 Connect to Your EC2 Instance (Linux)
Skip this if you’re not ready to connect today — no worries!
If you’re using a Mac/Linux terminal or Windows with WSL or Git Bash:
bash:
chmod 400 your-key.pem
ssh -i your-key.pem ec2-user@your-public-ip

- Use the public IP from the instance page
- Accept the SSH connection prompt
Now you’re inside your cloud computer!
🧽 Clean Up (Optional for Now)
If you don’t want charges after the free tier:
- Go to EC2 > Instances
- Select your instance → Click Actions > Instance State > Terminate
📝 Quick Recap
- EC2 lets you run servers in the cloud
- You launched your first virtual machine
- You learned about AMIs, instance types, and key pairs
- You even connected to the server if you tried SSH!
🧪 Mini Challenge
✅ Launch one more EC2 instance
✅ Try connecting via SSH
✅ Explore some Linux commands like:
bash
ls
pwd
mkdir test

🔁 Navigate the Series:
⬅️ Day 4: S3 Basics
➡️Day 6: IAM Basics — Control Who Can Do What in AWS