MY FIRST EC2 PROJECT:Hosting a website on Aws as a beginner

###🚀 My First EC2 Project: Hosting a Website on AWS as a Beginner

As someone new to cloud computing, I recently took on the challenge of hosting my first website using Amazon EC2 (Elastic Compute Cloud). This project was a hands-on introduction to deploying a web server in the cloud, and it gave me a solid foundation in AWS infrastructure. Here’s how I did it—and how you can too.
🌐 What Is EC2?

Amazon EC2 is a service that lets you rent virtual servers in the cloud. Instead of buying physical hardware, you can launch an EC2 instance (a virtual machine) and run your applications from anywhere in the world. It’s scalable, flexible, and perfect for beginners who want to learn cloud hosting.

🛠### Step-by-Step: How I Hosted My Website

1. Creating an AWS Account

I started by signing up for an AWS Free Tier account, which gave me access to a t2.micro instance—ideal for small projects like mine.

2. Launching an EC2 Instance

From the AWS Management Console:

  • I opened the EC2 dashboard and clicked Launch Instance.
  • I named my instance “MyFirstWebsite”.
  • I selected Amazon Linux 2023 as my operating system.
  • I chose the t2.micro instance type to stay within the Free Tier.

3. Setting Up a Key Pair

To securely connect to my server, I created a key pair named wale-key.pem and downloaded it to my computer.

4. Configuring Security Groups

I configured the firewall to allow:

  • SSH (port 22) for remote access.
  • HTTP (port 80) so my website could be viewed publicly.

5. Connecting to the Instance

Using SSH, I connected to my EC2 instance:
bash
ssh -i “wale-key.pem” ec2-user@

6. Installing Apache Web Server

Once inside the server, I installed Apache:
bash
sudo yum update -y
sudo yum install httpd -y
sudo systemctl start httpd
sudo systemctl enable httpd

7. Creating My First Web Page

I created a simple HTML page:
bash
echo “

Hello from Wale’s EC2!

” | sudo tee /var/www/html/index.html

8. Accessing the Website

I opened my browser and entered the public IP of my EC2 instance. Voilà! My website was live.

💡 What I Learned

  • How to launch and configure a virtual server.
  • Basics of Linux command line and SSH.
  • Installing and running a web server.
  • Managing security groups and firewall rules.

🔮 What’s Next?

Now that I’ve hosted a static website, I’m excited to explore:

  • Hosting dynamic sites with Node.js or PHP.
  • Deploying WordPress on EC2.
  • Setting up a custom domain and SSL certificate.

📌 Final Thoughts

Launching my first EC2 instance was a rewarding experience. It demystified cloud hosting and gave me confidence to build more complex projects. If you’re a beginner looking to get started with AWS, EC2 is a fantastic place to begin.

Similar Posts