DEV Community

Yash Sonawane
Yash Sonawane

Posted on

EC2 for Beginners: Launch, SSH, and Host a Website in 15 Minutes ๐Ÿš€

"Waitโ€”youโ€™re telling me I can launch a live website from scratch in 15 minutes using AWS EC2?" Yup. Let's do it together.


๐Ÿง  What is EC2 (and Why Should You Care)?

Amazon EC2 (Elastic Compute Cloud) is your rental computer in the cloud. You can spin up a server in minutes, install anything you want on it, and use it just like your own computerโ€”except it runs 24/7, from anywhere in the world.

Real-life analogy: EC2 is like renting a hotel room. You donโ€™t own it, but you can stay, install your stuff, host a party (or website), and leave when you're done.

Perfect for:

  • Hosting websites
  • Running backends and APIs
  • Learning Linux and DevOps

๐Ÿ› ๏ธ What You'll Need

  • An AWS account (free tier works!)
  • Basic terminal knowledge
  • 15 minutes of focus

โš™๏ธ Step 1: Launch Your EC2 Instance

1. Go to EC2 Dashboard

๐Ÿ‘‰ https://console.aws.amazon.com/ec2

2. Click โ€œLaunch Instanceโ€

  • Name: MyFirstEC2
  • AMI (OS): Amazon Linux 2
  • Instance Type: t2.micro (Free Tier)
  • Key Pair: Create a new one (download the .pem file and save it safely!)
  • Security Group: Allow SSH (port 22) and HTTP (port 80)

3. Click "Launch"

Boom! Your cloud computer is spinning up ๐ŸŽ‰


๐Ÿ” Step 2: Connect via SSH

On Mac/Linux:

chmod 400 my-key.pem
ssh -i my-key.pem ec2-user@<your-ec2-public-ip>
Enter fullscreen mode Exit fullscreen mode

On Windows:

Use Git Bash or PuTTY

If you see ec2-user@ip-... โ€” youโ€™re in. Welcome to the cloud, captain โ˜๏ธ๐Ÿง‘โ€โœˆ๏ธ


๐ŸŒ Step 3: Host a Website

Letโ€™s install a web server (Apache) and serve a simple HTML page.

๐Ÿ”ง Install Apache

sudo yum update -y
sudo yum install httpd -y
sudo systemctl start httpd
sudo systemctl enable httpd
Enter fullscreen mode Exit fullscreen mode

๐Ÿ“ Create Your Website

echo "<h1>Hello from EC2!</h1>" | sudo tee /var/www/html/index.html
Enter fullscreen mode Exit fullscreen mode

๐ŸŒ Open in Browser

Go to http://<your-ec2-public-ip>

Boom ๐Ÿ’ฅ! Your website is live on the internet.


๐Ÿ’ก Bonus Tips

  • Want to upload real files? Use scp or FileZilla.
  • Want to go serverless next? Try AWS Amplify or S3 hosting.
  • Want to set up a custom domain? Use Route 53 or GoDaddy + DNS settings.

๐Ÿง  Summary

Step What You Did
1๏ธโƒฃ Launched an EC2 instance
2๏ธโƒฃ SSH-ed into your cloud server
3๏ธโƒฃ Installed Apache and hosted a webpage

All in under 15 minutes. And you did it yourself. ๐Ÿ™Œ


๐Ÿ’ฌ Letโ€™s Build More Together!

If you followed this and got your website liveโ€”congrats! Youโ€™ve just unlocked Level 1 of your cloud dev journey.

What do you want to build next? A database server? WordPress? A CI/CD pipeline?

๐Ÿ‘‡ Drop a comment, hit the โค๏ธ, and share this with someone who needs a confidence boost in tech.

Letโ€™s demystify cloud one server at a time. โ˜๏ธ๐Ÿ› ๏ธ๐Ÿ’ป

Top comments (0)