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)