Amazon Elastic Compute Cloud
Amazon EC2 provides secure, resizable compute capacity in the cloud. It lets you launch virtual servers in minutes, with complete control over your computing environment.
EC2 is the foundational compute service of AWS, providing virtual machines known as "instances."
Launched in 2006, Amazon EC2 changed the way companies think about infrastructure. Instead of buying physical servers and waiting weeks for delivery, you can launch a virtual server in minutes. You choose the operating system, CPU, memory, storage, and network performance — and you pay only for what you use.
EC2 instances run on physical hosts managed by AWS. Multiple instances (from different customers) may run on the same physical server, but they are isolated using the Xen hypervisor. This multi-tenant model is what makes cloud computing cost-effective.
Choose the instance that fits your workload.
| Family | Name | Use Case | vCPU / Memory |
|---|---|---|---|
| General Purpose | t3, m7g | Web servers, small databases | 2-48 vCPU / 8-192 GB |
| Compute Optimized | c7g, c6i | Batch processing, gaming | 4-64 vCPU / 8-128 GB |
| Memory Optimized | r7g, x2idn | In-memory caches, SAP | 4-128 vCPU / 32-4096 GB |
| Storage Optimized | i4i, d3 | Data warehousing, log processing | 4-64 vCPU / 32-512 GB |
| GPU Instances | p5, g5 | ML training, video rendering | 8-192 vCPU / 32-2048 GB |
From AMI to running instance.
Choose AMI
Select OS — Amazon Linux, Ubuntu, Windows, etc.
Pick Instance Type
Choose vCPU, memory — t3.micro, m5.large, etc.
Configure Security
Security Groups, Key Pair, VPC placement
Add Storage
Attach EBS volumes — gp3, io2, or instance store
Launch & Connect
SSH or RDP into your new instance
AMI (Amazon Machine Image): A template that contains the OS, software, and configuration. You can use AWS-provided AMIs, marketplace AMIs, or your own custom AMIs.
Security Groups: Virtual firewalls that control inbound and outbound traffic. You can allow SSH (port 22), HTTP (port 80), or restrict access to specific IPs.
Key Pairs: SSH key pairs (.pem files) for secure access to Linux instances. Windows instances use admin passwords encrypted with the key pair.
Why EC2 is the most popular cloud computing service.
Scale up or down in minutes. Combine with Auto Scaling to automatically adjust capacity based on demand.
On-Demand, Reserved, Spot Instances, and Savings Plans — choose the best pricing model for your workload.
Integrates with VPC, IAM, Security Groups, and NACLs. Encrypt data with AWS KMS. Achieve compliance certifications.
Available in 30+ regions and 100+ availability zones worldwide. Deploy close to your users for low latency.
Persistent block-level storage volumes for EC2. SSD and HDD options available. Snapshots for backup.
Distribute traffic across multiple Availability Zones for high availability.