Amazon EC2 (Elastic Compute Cloud) is Amazon Web Services’ (AWS) service for renting virtual servers in the cloud. With EC2 you launch as many virtual servers (called instances in AWS) as you need, choose the processor and memory capacity, configure network and security settings and pay only for the time you use. You can increase capacity when the load grows and reduce it when the load falls.
Key EC2 Concepts
| Concept | What it does |
|---|---|
| Instance | A virtual server in the AWS cloud. |
| AMI (Amazon Machine Image) | A ready-made server template containing the operating system and software (Amazon Linux, Ubuntu, Windows Server, etc.). |
| Instance type | Different combinations of processor, memory, storage, network and GPU hardware (families for general purpose, compute, memory, storage or accelerated computing). |
| EBS volume | A persistent disk whose data is kept even when the instance is stopped (Elastic Block Store). |
| Instance store | A temporary disk; its data is deleted when the instance is stopped, hibernated or terminated. |
| Key pair | Secure login credentials for the server; AWS stores the public key and you keep the private key. |
| Security group | A virtual firewall that defines which protocols, ports and IP ranges are allowed access. |
| Elastic IP | A static public IP address that can be assigned to an instance. |
| Region / Availability Zone | The geographic region where the server runs, and the separate groups of data centres within that region. |
EC2 Pricing Models
- On-Demand: Pay per second (minimum 60 seconds) with no commitment or upfront payment.
- Savings Plans: A discount in return for committing to a certain hourly spend (in USD) for 1 or 3 years.
- Reserved Instances: A discount for a 1- or 3-year commitment to a specific instance type and region.
- Spot Instances: Use AWS’s spare capacity at a much lower price; because AWS can take the capacity back, they are for interruption-tolerant workloads.
- Dedicated Hosts: A physical server reserved for you; for using software licences tied to a server.
- Free tier: According to the AWS page, new customers can get up to 200 USD in credits that can be used for up to 6 months, and EC2 is included. Terms can change, so check aws.amazon.com/free.
Your bill includes not only server time but also items such as EBS disks, snapshots, Elastic IPs and data transferred out to the internet. Calculate the cost in advance with the AWS Pricing Calculator and set up a billing alert.
How to Launch a Server on EC2
- Create an AWS account and open the EC2 console; choose the region in the top right.
- With Launch instance, give the server a name and choose an AMI (for example Ubuntu Server or Windows Server).
- Choose the instance type; a small general-purpose type is enough for a small website.
- Create a key pair and store the private key file somewhere safe.
- In the security group, open only the ports you need (for example SSH 22 only to your own IP, and 80/443 for the web).
- Set the disk (EBS) size and launch the instance; connect with SSH on Linux or RDP on Windows.
EC2 or VPS?
| Amazon EC2 | Classic VPS / cloud server | |
|---|---|---|
| Billing | Usage-based; traffic, disk and IP are separate items | Usually a fixed monthly plan |
| Scaling | Auto scaling, load balancing, multiple regions | By upgrading the plan |
| Management | Large AWS ecosystem, steeper learning curve | Simpler panel and local support |
| Best suited for | Variable load, applications integrated with AWS services | Websites, e-commerce, application servers, a predictable budget |
For projects that serve visitors in Türkiye and want to keep costs fixed, our VPS server or cloud server plans are a more predictable option. For cloud concepts, see our articles what is cloud computing and virtualisation.
Frequently Asked Questions
Is EC2 free?
New AWS accounts can try EC2 free for a while with free tier credits. When the credits or the period run out, usage is charged; when the trial ends, remember to delete instances, disks and Elastic IPs you are not using.
Am I still charged if an EC2 instance is stopped?
You are not charged for compute on a stopped instance, but attached EBS disks and, in some cases, Elastic IPs continue to be charged. To stop all charges, you need to terminate and delete the resources.
Categories
-
CentOS 7 guides
-
cPanel 20 guides
-
CyberPanel 18 guides
-
Operating Systems 81 guides
-
Juniper Networks 18 guides
-
Control Panels 50 guides
-
Linux 17 guides
-
MySQL 29 guides
-
Network 95 guides
-
Plesk Panel 12 guides
-
Virtual Servers 273 guides
-
SEO 3 guides
-
Cyber Security 8 guides
-
Technology 162 guides
-
VMware 36 guides
-
WordPress 20 guides
-
Artificial Intelligence 22 guides