Cloud computing can feel intimidating at first - all the talk of regions, instances, VPCs, and security groups might seem like another language. But launching an EC2 instance on AWS? Surprisingly simple.
In this post, I'll walk you through how I created a basic EC2 instance, what I learned along the way, and how you can do it too - even if you're using Windows with PuTTY to connect.
🧠 What is an EC2 Instance?
Amazon EC2 (Elastic Compute Cloud) is a virtual server in Amazon's cloud. You can use it to host websites, run code, experiment with server setups, or even train ML models.
Think of it like renting a computer in the cloud - you control everything about it.
**
🛠️ Step-by-Step: How I Did It
**
1. Logged into AWS Console
First, I signed in to the AWS Management Console. If you don't have an account, sign up at aws.amazon.com.
2. Navigated to EC2 Dashboard
From the AWS Services menu, I selected EC2. This took me to the EC2 Dashboard, where I could manage instances, volumes, security groups, and more.
3. Clicked "Launch Instance"
On the dashboard, there's a big blue button: Launch Instance. That's where it begins.
4. Configured the Instance
Here's what I chose:
- Name: my-first-ec2
- Amazon Machine Image (AMI): Amazon Linux 2 (free-tier eligible)
- Instance Type: t2.micro (1 vCPU, 1GB RAM – perfect for starters)
- Key Pair: I created a new key pair and downloaded the .pem file for SSH access.
- Network Settings: I allowed SSH (port 22) so I could log in remotely.
5. Launched It
Clicked "Launch Instance" and waited ~30 seconds. Boom - my first cloud server was live!
🔒 Setting Up Security Groups (Allowing Inbound Traffic)
One of the most important steps was configuring inbound traffic via a security group. A security group acts like a virtual firewall, controlling traffic to and from your instance.
For inbound rules, I allowed SSH (port 22) from my IP address only so I could connect to the instance securely via PuTTY. I also enabled HTTP (port 80) and HTTPS (port 443) from anywhere (0.0.0.0/0) to allow future web traffic to reach the server, in case I want to host a website or run a web app. This setup ensures I can access the server securely while also keeping the door open for standard web traffic.
💡 Why These?
SSH lets me connect to the instance remotely.
HTTP & HTTPS are needed if I plan to host any kind of web content or server.
⚠️ Tip: Restrict SSH access to your IP for security._ Never leave port 22 open to the world unless absolutely necessary.
_
🚪 Launched the Instance
Once the security group was configured, I clicked Launch Instance and within 30 seconds, I had my cloud server running.
🔐 Connecting to the EC2 Instance on Windows using PuTTY
Since I was using a Windows system, I connected to my instance using PuTTY, a free SSH client.
Here's what I did:
- Converted the .pem file to .ppk:
- Downloaded and opened PuTTYgen.
- Clicked Load, selected the .pem file.
- Clicked Save private key and saved the file as my-key.ppk.
Opened PuTTY and entered connection details:
- Host Name (or IP address): ec2-user@
- In the left menu, under Connection > SSH > Auth, I browsed to the my-key.ppk file.
Connected:
- Clicked Open and accepted the SSH security prompt.
- I was now logged into my EC2 instance via the command line!
🧼 Cleaning Up (IMPORTANT!)
After testing, I stopped and terminated the instance to avoid unexpected charges. Always shut down resources you're not using.
💡 What I Learned
- Cloud isn't as scary as it seems.
- AWS gives you a lot of control - which means you must manage it responsibly.
- On Windows, PuTTY and PuTTYgen are your best friends for connecting via SSH.
- Always save your private key file - and never share it.
5.
🧭 What's Next?
- Hosting a static website using EC2.(Wair, alreday did that , check it out :https://medium.com/@deykaustav357/how-i-made-my-first-static-website-using-amazon-s3-as-an-aws-beginner-476a9232f360 )
- Attaching an EBS volume for persistent storage.
- Learning about AMIs and how to create custom images.
🎯 Final Thoughts
Launching an EC2 instance is like a rite of passage in the cloud world. It's the gateway to a huge universe of cloud computing possibilities.
If you've been hesitant, just try it - AWS's free tier gives you 750 hours/month of t2.micro usage. Play, break things, and learn.
If I can do it, so can you.