Cloud Made Easy: Amazon EC2 Basics


The most successful people are those with the best habits - James Clear
Hello Cloud Learners,
Hope everyone doing great and keeping your best habits.
Recently I had given my first AWS Technical talk in AWS UG Dubai and it’s proud moment for me to share my knowledge and continue to do more.
Many thanks for your great support and feel that I’m adding little bit of knowledge on your Cloud computing upskilling journey.
Let’s jump into today’s Cloud made easy concept: Amazon EC2 Basics
Welcome! I’m here to break down Amazon EC2 (Elastic Compute Cloud) into the simplest terms possible. Think of this as your friendly guide to building something amazing in the cloud.
So, what’s the big deal with EC2? It’s a service from Amazon Web Services (AWS) that lets you rent a virtual computer (called an instance) over the internet. No need to buy expensive hardware or worry about fixing it-just click a few buttons, and you’ve got a server ready to use. Let’s dive in and explore every piece of EC2 step by step, so by the end, you’ll have launched your very first virtual server!
What is AWS EC2? (Think of It Like Renting a Computer)
Imagine you want a powerful computer to run a website, test an app, or store files, but you don’t want to spend thousands of dollars buying one. Amazon EC2 is like renting that computer from a huge tech store (AWS). You pick the size and type of computer you need, use it for as long as you want, and only pay for the time it’s on. If you don’t need it anymore, just turn it off-no extra cost!
Why Use EC2?
Save Money: No need to buy a real server. Pay only for what you use (sometimes just a few cents per hour).
Super Flexible: Need more power? Add it. Need less? Reduce it. You’re in control.
Fast Setup: Get a server running in minutes, not days.
Safe and Secure: AWS keeps your virtual computer protected in their giant, secure data centers.
Real-Life Example: Let’s say you’re in Dubai and want to start a small online shop. Instead of buying a server machine, you can use EC2 to create a virtual one, host your shop online, and only pay a tiny amount while you’re learning or growing your business.
The Basic Pieces of EC2 (Explained Like Building a House)
Before we build anything, let’s understand the tools and parts of EC2. I’ll explain each one like we’re building a house, so it’s easy to picture.
1. Instance – Your House in the Cloud
An EC2 instance is your virtual computer or server. It’s like the house you’re building in the AWS Cloud. You can put anything inside it-software, websites, or games-and decide what it looks like (Windows or Linux).
Example: If you want to make a personal blog, your instance is the house where your blog lives online.
2. Amazon Machine Image (AMI) – Your House Blueprint
An AMI is a ready-made plan for your house. It has the basic setup already done, like the operating system (think of it as the foundation and walls) and sometimes extra tools or apps. You pick an AMI when starting your instance, so you don’t have to build everything from scratch.
Example: Choosing an “Amazon Linux 2 AMI” means your house starts with Linux already set up, and it’s free for beginners.
3. Instance Type – The Size of Your House
The instance type decides how big and strong your house is. A small type like “t2.micro” is like a tiny apartment-perfect for learning and free under AWS’s Free Tier. A bigger type like “c5.xlarge” is like a mansion-great for heavy work but costs more.
Example: Start with “t2.micro” to practice without paying. It’s like renting a small room to test your ideas.
4. Key Pair – Your House Key
A key pair is like the key to your front door. It’s a special file that lets you enter your house (instance) securely. AWS keeps one part (public key), and you download the other part (private key) to your computer. Don’t lose it-if you do, you can’t get inside!
Example: When you create a key pair, you download a file (like “mykey.pem”). Keep it safe to unlock your instance late.
5. Security Group – Your House Security Guard
A security group is like a guard at your door. It decides who can come in or go out of your house. You make rules, like “only let my computer connect” or “allow everyone to see my website.” Without rules, no one can enter.
Example: Set a rule to allow “SSH on port 22” so only you can log in from your device.
6. Storage – Your House Storage Room
Your instance needs a place to store things like files or apps. EC2 gives you two options:
Amazon EBS (Elastic Block Store): Like a permanent storage room. Even if you turn off your house (stop the instance), your stuff stays safe.
Instance Store: Like a temporary shelf. If you turn off the house, everything on the shelf disappears.
Example: Use EBS to save your website files so they don’t get lost if you restart your instance.
7. Virtual Private Cloud (VPC) – Your Neighborhood
A VPC is like the private neighborhood where your house sits. It’s a safe, isolated area in the AWS Cloud just for your stuff. AWS gives you a default VPC to start with, so you don’t need to worry about setting it up right away.
Example: Your instance lives in a VPC, keeping it separate from other people’s houses for extra safety.
Here is my complete AWS Networking beginners guide
Let’s Build Your First House: Launching an EC2 Instance Step by Step
Now that you know the pieces, let’s build your first virtual server! I’ll walk you through every single step in the simplest way. If you get stuck, drop a comment-I’m here to help. (Note: Adding screenshots or videos to these steps on your blog or platform can make it even clearer.)
Step 1: Sign Up for AWS (Get Your Cloud Pass)
Go to aws.amazon.com and click “Create a Free Account.”
Fill in your details (email, password) and add a credit/debit card (don’t worry, you won’t pay if you stick to the Free Tier).
AWS Free Tier gives you 750 hours of “t2.micro” usage per month for free-plenty of time to learn!
Tip: If you’re in Dubai, choose a nearby region like “Middle East (UAE)” for faster connection.
Step 2: Go to the EC2 Dashboard (Your Control Room)
Log in to the AWS Management Console (the main control panel).
In the search bar at the top, type “EC2” and click on the EC2 service.
You’ll see the EC2 Dashboard-a place to manage all your virtual servers.
Step 3: Launch Your Instance (Build Your House)
Follow these steps carefully to create your first instance:
Start Building: On the EC2 Dashboard, click the orange button that says “Launch Instance”
Name It: Under “Name and tags,” give your instance a name like “MyFirstServer” so you can find it later
Pick a Blueprint (AMI): Under “Application and OS Images,” choose “Amazon Linux 2 AMI” from the Quick Start list. It’s marked “Free Tier eligible,” so it won’t cost you anything
Choose Size (Instance Type): Under “Instance type,” select “t2.micro.” It’s free under the Free Tier and good for small projects. (In some regions, it might be “t3.micro”-that’s fine too)
Create a Key (Key Pair): Under “Key pair (login),” click “Create new key pair.” Name it something like “MyKey,” choose “.pem” format (or “.ppk” if using Windows with PuTTY), and click “Create key pair.” Download the file and keep it in a safe place-you’ll need it to log in.
Set Security (Security Group): Under “Network settings,” make sure “Allow SSH traffic from” is set to “My IP.” This means only your computer can connect to the instance for safety.
Storage: Leave the default storage (usually 8 GB of EBS). It’s enough for now and free under the Free Tier
Final Check and Launch: Look at the “Summary” on the right side. If everything looks good, click “Launch instance” at the bottom.
Step 4: Wait and Connect (Enter Your House)
After clicking “Launch instance,” AWS will take 1-2 minutes to build your server. You’ll see a “Success” message. Click “View Instances” to go back to the dashboard.
On the dashboard, find your instance (named “MyFirstServer”). Wait until its status says “Running” with a green dot.
Select your instance by checking the box next to it, then click the “Connect” button at the top.
In the “Connect to instance” window, choose the “SSH client” tab. You’ll see instructions and a command like this:
bashssh -i "MyKey.pem" ec2-user@<your-instance-public-IP>
For Mac or Linux Users: Open a terminal on your computer, go to the folder where you saved “MyKey.pem,” and paste the command. Hit Enter to connect.
For Windows Users: Download a tool called PuTTY. Use PuTTYgen to convert your “.pem” file to “.ppk,” then use PuTTY to connect with your instance’s public IP address.
Tip: If you can’t connect, make sure your key file is safe and your security group allows SSH from your IP. Ask in the comments if you’re stuck
Congratulations!
You’ve just launched and connected to your first virtual server in the cloud! When you’re connected, type a simple command like hostname
to see your server’s name. You’re now inside your virtual house-how cool is that?
What Can You Do With Your EC2 Instance? (Ideas to Try)
Now that you have a server, here are some fun and useful things to do with it:
Make a Website: Install software like Apache to host a small website or blog. Show off your work to the world!
Test an App: If you’re a coder (hey, Dev.to folks!), use it to test apps without slowing down your own computer.
Learn Skills: Practice Linux commands (like
ls
to list files) or set up a game server for friends.Store Files: Use it as a safe place to keep backups or important data with EBS storage.
Example for Readers: If you’re running a small business, use your instance to host a basic online store or portfolio site. Since AWS has a data center across the world, your site will load fast for local customers.
Important Tips to Stay Safe and Save Money
Turn It Off When Not Using: If you’re done, go to the EC2 Dashboard, select your instance, and click “Stop instance” (like pausing) or “Terminate instance” (like deleting). This stops extra charges. Even in Free Tier, unused hours don’t roll over, so manage wisely.
Don’t Lose Your Key: Keep your key pair file (like “MyKey.pem”) in a safe spot. If you lose it, you can’t log in, and AWS can’t help you get it back.
Stick to Free Tier: Use “t2.micro” and check your usage in the AWS Billing Dashboard to avoid surprise bills. Free Tier gives you 750 hours per month-plenty for learning.
Check Security: Make sure your security group only allows trusted connections. Don’t open it to everyone unless needed (like for a public website).
Let’s Talk! I’m Here for You
What do you plan to do with your first EC2 instance? Build a site? Learn coding? Or just play around? Drop your ideas or any questions in the comments-I read and reply to every single one, whether you’re on my blog, Dev.to, or Community.aws.
If you’re stuck (like can’t connect via SSH), tell me what’s happening, and I’ll help you fix it. Let’s make sure everyone succeeds!
Follow Me for More Cloud Magic!
If you found this helpful, hit Follow on my personal blog, Dev.to, or Community.aws profile. I’ve got more easy tutorials coming-like how to secure your EC2 instance and save even more money.
Next Post Teaser: I’ll show you how to protect your virtual house from online dangers with simple security tricks. Don’t miss it!
Thanks for joining me in the cloud! ☁️🚀
Subscribe to my newsletter
Read articles from Logeswaran directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Logeswaran
Logeswaran
Curious to learn new things and cloud computing enthusiast.