EC2 (cloud compute)
Also known as: Elastic Compute Cloud, EC2 instance, AWS virtual machine
EC2 (Elastic Compute Cloud) is AWS's virtual machine service.
You choose a CPU/RAM configuration, pick an operating system, and get a server running in the cloud within minutes. You can scale from one instance to thousands and only pay for the time they run.
EC2 (cloud compute), explained at three levels
At home
Imagine renting a computer that lives in Amazon's data center. You can install whatever software you want, run it 24/7, and turn it off when you're done -- paying only for the hours it was on. That's EC2.
At work
EC2 lets companies run servers without buying hardware. Need a web server? Launch an EC2 instance. Need 500 servers for a Black Friday sale? Launch 500, then terminate them when the rush is over.
At home
EC2 instances come in families: t-series (burstable, cheap), m-series (general purpose), c-series (compute-optimized), r-series (memory-optimized), and p/g-series (GPU). You choose an AMI (Amazon Machine Image) -- a snapshot with an OS and optional pre-installed software -- to launch from.
At work
Teams typically run EC2 behind an Auto Scaling Group that adds instances under load and removes them when traffic drops. An Application Load Balancer distributes traffic across instances. Instances can be On-Demand (pay per hour), Reserved (1-3 year commitment, up to 72% savings), or Spot (bid on unused capacity, up to 90% off but can be interrupted).
At home
EC2 runs on AWS Nitro, a custom hypervisor that offloads networking and storage to dedicated hardware, giving instances near-bare-metal performance. Nitro-based instances also support ENA (Elastic Network Adapter) for 100 Gbps networking.
At work
Production EC2 architectures use placement groups (cluster, partition, or spread) to control physical locality for latency or fault isolation. Dedicated Hosts give tenancy control for licensing compliance. EBS-optimized instances provide dedicated throughput to attached volumes, and instance store provides ephemeral NVMe storage at very high IOPS.
Real-world examples
At home
Thomas spun up a t3.micro EC2 instance (free tier eligible) to host a personal project. He SSH'd in, installed Node.js, and deployed his app -- the whole thing cost less than $10/month.
At work
Nadia's team uses an Auto Scaling Group of c5.2xlarge EC2 instances behind an ALB for their image processing API. At night, the group scales down to 2 instances; during daytime peak hours, it automatically expands to 20.
Common confusions
- EC2 is just a basic virtual machine with no cloud benefits — EC2 integrates deeply with AWS -- auto-scaling, load balancing, IAM roles, VPC networking, CloudWatch monitoring, and hundreds of other services are all natively connected.
- You need to keep EC2 running even when your app isn't being used — You can stop instances (halting charges) or use AWS Lambda/Fargate for workloads that should run only on demand, with no idle cost.
For analysts
BAs and data analysts sometimes use EC2 to run heavy data processing jobs -- a large r5 instance with 256 GB RAM can process datasets that would crash a laptop, and you can terminate it when the job is done.
History & origin
Amazon launched EC2 as one of AWS's first two services in August 2006. Early instances were slow by modern standards -- the smallest had 1.7 GB RAM -- but the concept of renting a server by the hour was revolutionary. EC2 helped launch the cloud computing era and has since expanded to hundreds of instance types covering general purpose, memory-optimized, GPU-accelerated, and ARM-based workloads.