AWS Builder Center
Day 3: Amazon EC2 – Launching My First Virtual Server

Day 3: Amazon EC2 – Launching My First Virtual Server

Day 3 of my 90-day AWS challenge: what Amazon EC2 is, the key concepts behind it (AMIs, instance types, key pairs, security groups), and how I launched and safely shut down my first virtual server.

Recap of Day 2

Yesterday I learned how IAM controls access with users, groups, roles, and policies. Today I'm using that secure setup to launch my first virtual server on Amazon EC2.

What is Amazon EC2?

EC2 (Elastic Compute Cloud) gives you resizable virtual servers, called instances, in the cloud. You choose the operating system, CPU, memory, and storage, and you pay only for the time you run it.

Key concepts

ConceptWhat it is
AMIA template with the operating system and software for your instance (e.g., Amazon Linux)
Instance typeThe hardware size: CPU, memory, network (e.g., t3.micro)
Key pairA public/private key used to log in securely over SSH
Security groupA virtual firewall that controls inbound and outbound traffic
EBS volumeThe disk storage attached to your instance

EC2 pricing models

  • On-Demand: pay per second or hour, no commitment
  • Reserved / Savings Plans: lower price for a 1 or 3 year commitment
  • Spot: spare capacity at big discounts, but it can be interrupted

How I launched my first instance

  1. Opened the EC2 console and chose my Region
  2. Clicked Launch instance and named it
  3. Selected an Amazon Linux AMI
  4. Chose a free-tier eligible instance type
  5. Created a key pair and downloaded the private key file
  6. Configured the security group to allow SSH only from my IP
  7. Launched the instance and connected to it

Stop vs. Terminate

  • Stop: shuts the instance down, but the EBS volume stays and still costs a little
  • Terminate: deletes the instance permanently
I terminated my instance after practicing so I wouldn't be charged for it.

Key takeaways

  • Never open SSH to the whole internet (0.0.0.0/0); restrict it to your own IP
  • Keep your private key file safe and never share or upload it
  • Always stop or terminate practice instances, and keep your billing alert on

Up next: Day 4

Amazon S3: storing and serving files in the cloud.
Learning AWS too? Follow along and share what you're building. #90DaysOfAWS
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article