Infrastructure as a Service (IaaS) lets you rent servers, storage and networks over the internet and pay only for what you use, instead of buying hardware. In this article we unpack what IaaS is, how it compares to PaaS and SaaS, and then use Amazon EC2 on AWS as a hands-on case study: you will launch a real web server in the cloud in a few minutes.
If you have ever waited weeks for a physical server, or paid for one that sat idle most of the month, IaaS is the fix.
What is IaaS?
IaaS is the cloud service model where a provider runs the physical data centre, hardware and virtualization, and you get on-demand virtual machines, disks and networks to build on. You still manage the operating system, runtime, applications and data.
The easiest way to see where IaaS fits is to compare who manages what in each model:
Layer
On-premises
IaaS
PaaS
SaaS
Applications
You
You
You
Provider
Data
You
You
You
Provider
Runtime and middleware
You
You
Provider
Provider
Operating system
You
You
Provider
Provider
Virtualization
You
Provider
Provider
Provider
Servers, storage, networking
You
Provider
Provider
Provider
Example
Your own server room
Amazon EC2, Azure VMs, Google Compute Engine
Heroku, Google App Engine
Gmail, Slack
In short: IaaS gives you the most control of the three cloud models, and with it the most responsibility.
The building blocks of IaaS
Every IaaS platform, whatever it calls them, offers the same core pieces:
• Compute: virtual machines you size by CPU and memory, started and stopped on demand.
• Storage: block storage (virtual disks attached to a VM), object storage (files and backups) and file storage (shared drives).
• Networking: private virtual networks, subnets, public IPs, firewalls and load balancers.
• Identity and access: users, roles and keys that control who can create or touch resources.
• Monitoring and automation: metrics, logs, alerts and APIs so infrastructure can be scripted instead of clicked.
Because everything is exposed through an API, you can treat infrastructure as code: describe servers in a file and recreate them identically at any time.
Case study: Amazon EC2
Amazon Elastic Compute Cloud (EC2), launched by AWS in 2006, is one of the oldest and most widely used IaaS offerings. It runs workloads ranging from student side projects to large streaming services such as Netflix, which moved its infrastructure onto AWS over several years.
Here is how the generic IaaS building blocks map to EC2 and its neighbouring AWS services:
IaaS building block
AWS service or feature
What it does
Virtual machine
EC2 instance
A server you choose by instance type (CPU, memory, network)
Machine image
Amazon Machine Image (AMI)
Template with the OS and software to boot from
Block storage
Amazon EBS volume
A persistent virtual disk attached to an instance
Object storage
Amazon S3
Stores files, backups and static assets
Private network
Amazon VPC and subnets
Your isolated network in the AWS cloud
Firewall
Security groups
Allow or deny traffic by port and source
Access control
IAM users and roles; SSH key pairs
Who can manage resources and log in to servers
Scaling
Auto Scaling groups and Elastic Load Balancing
Add or remove instances with demand and spread traffic
Monitoring
Amazon CloudWatch
Metrics, logs and alarms
EC2 instance types are grouped into families by purpose: general purpose (the T and M families), compute optimized (C), memory optimized (R and X), storage optimized (I and D) and accelerated computing with GPUs (P and G). Picking the right family is the first real cost and performance decision you make.
Hands-on: launch a web server on EC2
You will launch a small Linux instance that serves a web page with Nginx. You need an AWS account; new accounts get Free Tier benefits, so check the current terms on the AWS Free Tier page before you start.
- Sign in to the AWS Management Console, pick a region close to your users, and open EC2.
- Click Launch instance and give it a name, for example my-first-iaas-server.
- Under Application and OS Images, choose Amazon Linux 2023.
- Under Instance type, choose a small general-purpose type such as t3.micro.
- Under Key pair, create a new key pair and download the .pem file. You cannot download it again.
- Under Network settings, allow SSH from My IP only, and allow HTTP from anywhere.
- Expand Advanced details and paste this into User data, so the server configures itself on first boot: #!/bin/bash dnf update -y dnf install -y nginx echo "
Hello from IaaS on Amazon EC2
" > /usr/share/nginx/html/index.html systemctl enable --now nginx - Click Launch instance, wait until the state is Running, then copy its Public IPv4 address.
- Open http:// in a browser. You should see your Hello page. To log in to the server itself, use the key pair you downloaded: chmod 400 my-key.pem ssh -i my-key.pem ec2-user@ Prefer the terminal? With the AWS CLI configured, the same launch is one command (replace the placeholder IDs with your own): aws ec2 run-instances \ --image-id \ --instance-type t3.micro \ --key-name my-key \ --security-group-ids \ --user-data file://setup.sh \ --tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=my-first-iaas-server}]' Clean up when you are done: select the instance and choose Instance state → Terminate so you are not billed for a server you forgot about. Notice what just happened: no hardware purchase, no cabling, no waiting. That is the core promise of IaaS. Pricing, benefits and challenges EC2 bills you only for the capacity you run, and offers several pricing models depending on how predictable your workload is: Pricing model Best for Trade-off On-Demand New projects, unpredictable traffic Highest per-hour price, no commitment Savings Plans and Reserved Instances Steady workloads running for 1 or 3 years Big discount in exchange for a commitment Spot Instances Batch jobs, CI builds, fault-tolerant work Steepest discount, but AWS can reclaim the instance at short notice Dedicated Hosts Licensing or compliance needs Physical server reserved for you, at a premium Exact prices vary by region and instance type, so use the AWS Pricing Calculator before committing. Benefits of IaaS, as seen with EC2: • Speed: a server is ready in minutes, not weeks. • Elasticity: scale out for a traffic spike, scale back in when it ends. • No upfront capital cost: hardware becomes an operating expense. • Global reach: deploy close to users in AWS regions around the world. • Control: full choice of OS, software and network layout. Challenges to plan for: • Shared responsibility: AWS secures the data centre; you must patch the OS, lock down security groups and protect keys. • Cost surprises: forgotten instances, unattached volumes and data transfer out can grow the bill quietly. Set billing alerts. • Skills needed: networking, Linux administration and security are now your job. • Vendor lock-in: heavy use of provider-specific services makes moving clouds harder. When to choose IaaS Choose IaaS when you need control that PaaS and SaaS do not give you, for example: • Migrating existing servers to the cloud with minimal changes ("lift and shift"). • Running custom software, specific OS versions or unusual networking setups. • Handling spiky or seasonal traffic you cannot predict. • Spinning up short-lived environments for testing, training or data processing. If you just want to deploy code without managing servers, a PaaS will save you time. If you just need the finished software, buy SaaS. Conclusion IaaS turns physical infrastructure into something you can create, resize and delete with a click or a line of code. Amazon EC2 shows the model clearly: you pick an image and an instance type, attach storage, open the right ports, and you have a server running in minutes, billed only while it runs. The trade-off is that the OS, security and cost discipline are yours to own. Try the hands-on steps above, then terminate the instance. Next, explore Auto Scaling groups and a load balancer to see the elastic side of IaaS in action. Have you used EC2 or another IaaS platform such as Azure or Google Cloud? Share your experience in the comments.


