Day 5: EC2 Basics — Launch Your First Cloud Server

Day 5: EC2 Basics — Launch Your First Cloud Server

Day 5: EC2 Basics — Launch Your First Cloud Server

Goal: Understand what EC2 is and launch your first virtual machine (server) using AWS EC2.


🖥️ What is EC2?

EC2 stands for Elastic Compute Cloud.

It lets you run virtual machines (VMs) in the cloud — just like a regular computer but on AWS.

🧠 Imagine:

“You rent a computer from AWS, and you can use it anytime, anywhere — no physical hardware needed.”


🔑 Why Use EC2?

  • Host websites or apps
  • Run scripts or software
  • Store data or run databases
  • Learn Linux or Windows server usage

💡 EC2 Basics in Simple Terms

TermWhat It Means
InstanceA virtual computer (server) you launch
AMIPre-built software image (e.g., Linux, Windows)
Instance TypeDefines how powerful your server is (CPU, RAM)
Key PairA password file to access your server
Security GroupLike a firewall; controls who can access your instance
Elastic IPA permanent IP address you can attach to your server

🛠️ Step-by-Step: Launch Your First EC2 Instance

  1. Go to AWS Console → Search for EC2 → Click the first result
  2. In the left menu, click “Instances”, then click “Launch Instances”
  3. Name your instance (e.g., my-first-ec2)
  4. Choose AMI (Operating System):
    • Select Amazon Linux 2023 (free tier eligible)
    • You can also choose Ubuntu or Windows, but Linux is simple for now.
  5. Instance type:
    • Select t2.micro or t3.micro (these are free tier eligible)
  6. Key Pair:
    • If you don’t have one, create a new key pair
    • Choose .pem and download it (keep it safe — you’ll use it to connect later)
  7. Network Settings:
    • Allow SSH (port 22) so you can connect via terminal
    • For now, allow from My IP (for safety)
  8. Click Launch Instance

🎉 Congratulations — your first cloud server is now running!


🔗 Connect to Your EC2 Instance (Linux)

Skip this if you’re not ready to connect today — no worries!

If you’re using a Mac/Linux terminal or Windows with WSL or Git Bash:

bash:

chmod 400 your-key.pem
ssh -i your-key.pem ec2-user@your-public-ip

  • Use the public IP from the instance page
  • Accept the SSH connection prompt

Now you’re inside your cloud computer!


🧽 Clean Up (Optional for Now)

If you don’t want charges after the free tier:

  • Go to EC2 > Instances
  • Select your instance → Click Actions > Instance State > Terminate

📝 Quick Recap

  • EC2 lets you run servers in the cloud
  • You launched your first virtual machine
  • You learned about AMIs, instance types, and key pairs
  • You even connected to the server if you tried SSH!

🧪 Mini Challenge

✅ Launch one more EC2 instance
✅ Try connecting via SSH
✅ Explore some Linux commands like:

bash

ls
pwd
mkdir test

🔁 Navigate the Series:

⬅️ Day 4: S3 Basics
➡️Day 6: IAM Basics — Control Who Can Do What in AWS

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *