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 centre. You pick how powerful it is, install whatever software you want, and reach it over the internet. When you're done, you turn it off and stop paying. Under the hood it's a virtual machine: one big physical server is sliced into several private computers, and you rent one slice. That's EC2.
At work
EC2 (Elastic Compute Cloud) rents virtual servers by the second or hour. A business picks a size, an operating system, and a network, and the server is running within minutes. The 'elastic' part is what matters commercially: a retailer can run five servers on a quiet Tuesday and five hundred during a Black Friday rush, paying only for what actually ran instead of buying for the peak.
At home
Each EC2 server, called an instance, is built from a few parts. The instance type sets CPU and memory, grouped into families: t for cheap burstable work, m for general purpose, c for compute-heavy jobs, r for memory-heavy ones, and g or p for GPUs. An AMI (Amazon Machine Image) supplies the operating system and software. EBS volumes act as its disks, and a security group decides which network traffic may reach it.
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 (spare capacity, up to 90% off but can be interrupted).
At home
Most EC2 instances run on the AWS Nitro System, which moves networking, storage, and security functions off the main processor onto dedicated cards, leaving a very thin hypervisor. That's why instances get near bare-metal performance, and why AWS can also rent actual bare-metal instances. The Elastic Network Adapter delivers 100 Gbps or more on larger types. In my view, Nitro is why EC2 performance feels predictable, though small burstable instances still slow down once their CPU credits run out.
At work
Production EC2 designs control where instances physically land. Placement groups come in three types: cluster packs instances close together for low-latency networking, partition separates groups onto different racks, and spread puts each instance on distinct hardware for fault isolation. Dedicated Hosts give per-socket visibility for licensing compliance. EBS volumes survive a stop, while instance store NVMe disks are fast but wiped when the instance stops. Spot interruptions and zone outages are the failures architects plan around.
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.