A Fun Guide to Launching EC2 on AWS and Installing a Web Server with PowerShell

A Fun Guide to Launching EC2 on AWS and Installing a Web Server with PowerShell

Are you ready to jump into the cloud and launch your own EC2 instance in AWS? Don't worry! This step-by-step guide is super simple and fun. You’ll also learn how to install a web server using PowerShell to get your website up and running in no time.

Let’s get started with the basics and then dive into the fun part: turning your EC2 instance into a web server.


Step 1: Sign In to AWS and Get Your Hands Dirty

Before you start, make sure you have an AWS account. If you don’t, go to AWS and create one. Once you've logged in, head over to the AWS Management Console.

Step 1.1: Go to EC2 Dashboard

  • In the search bar at the top, type "EC2" and click on the EC2 Dashboard.

  • You'll be in the EC2 section where you can launch new virtual machines, also known as instances.


Step 2: Launch Your EC2 Instance

Step 2.1: Choose an Amazon Machine Image (AMI)

  • Click the Launch Instance button to start the wizard and give it a name

  • For the first-time user, select the free-tier eligible option: I USED WINDOWS

  • because it is light, fast, and perfect for your web server.

Step 2.2: Choose Your Instance Type

  • Select t2.micro (free tier eligible), which is perfect for beginners and small project

  • Click Next: Configure key pair

Step 2.3: Configure key pair

  • For most simple use cases, you can leave the default settings. No need to change anything unless you want to fine-tune things but we need to get a key pair to enable us gain access to the instance.

  • Click Next: security group

Step 2.4: Configure Security Group

  • A security group is like a virtual firewall. You’ll need to make sure ports are open for web traffic (HTTP).

  • Click Add Rule, select HTTP (port 80), and SSH (port 22) to manage your instance.

  • If you want to manage the server remotely via PowerShell, allow SSH connections from your own IP address (for security).

  • Click Next: Add Tags.

Step 2.5: Add Tags (Optional)

  • You can add tags to help you organize your resources,this can also be done immediately after launching ec2 . For example, you can tag your instance as Name: stan ec2.

  • Click Next: add storage

Step 2.6: Add Storage (Optional)

  • Leave it as is for the free tier (8 GB is plenty).

Click Review and Launch.

Step 2.7: Launch the Instance

  • Now, click Launch and use the existing key pair after downloading RDP

  • Download and save the key pair file (.pem) somewhere safe—it’s the key to accessing your server.

Decrypting the pair key in order to get access by opening the downloaded files and copying and pasting or just uploading from the given button

Once your done follow the prompt to see the given password to your instance and copy it

Paste the password to gain access to your instance

AND YOUR IN !


Step 3: Install a Web Server on Your EC2 Instance using powershell

Now let’s turn your EC2 instance into a web server. We'll install a (HTTP server) for this purpose.

Step 4.1: Search for power shell in your instance menu

You need to activate power shell on your instance in order to in stall the web server, although there are other ways

Step 4.2: Install Web Server

To install, type the following command:

WAIT FOR IT! TO INSTALL

Step 4.3: Check if the web server is Running

Visit your EC2 instance’s public IP address in a browser (type the IP address into your browser’s address bar)

.Congratulations, you've got a web server up and running !


Step 5: Test It All

Now, let’s do a little victory dance because your web server is working! 🎉

  1. Open your web browser.

  2. Type the public IP of your EC2 instance into the address bar.

  3. If you see the Apache test page, you’ve done it! You’ve successfully launched an EC2 instance and set up a web server using PowerShell. 🎉


Conclusion: You’re Now the Cloud King!

You’ve just completed your first AWS EC2 launch and web server setup using PowerShell. It wasn’t so hard, right? With your new EC2 instance, you can host all kinds of web applications, blogs, or even start a project you’ve been dreaming about.

If you want to go further, you can start adding content to your server, install databases, or secure it with SSL. The sky's the limit!

Happy cloud computing! ☁️🚀