AWS EC2 Complete Guide
Ad
What is EC2?
Amazon EC2 (Elastic Compute Cloud) provides resizable virtual servers in the cloud. It's AWS's core compute service — rent a server by the second.
Launching an Instance
- Choose an AMI (OS image, e.g. Ubuntu).
- Pick an instance type (t2.micro is free-tier).
- Configure security groups (firewall).
- Create/select a key pair for SSH.
- Launch!
Connecting via SSH
ssh -i my-key.pem ubuntu@<public-ip>
Instance Types
| Family | Optimized for |
|---|---|
| t / m | General purpose |
| c | Compute (CPU) |
| r | Memory (RAM) |
| g / p | GPU (ML) |
Pricing Options
- On-Demand — pay per hour, no commitment.
- Reserved — cheaper for 1-3 year commitment.
- Spot — up to 90% off spare capacity.
FAQs
What is an AMI?
Amazon Machine Image — a template with the OS and software. More in our AWS section.
What's a security group?
A virtual firewall controlling inbound/outbound traffic to your instance.
