DEV Community

Cover image for How to Create and Set Up an EC2 Instance on AWS and Install IIS Web Server
Kosisochukwu Ugochukwu
Kosisochukwu Ugochukwu

Posted on

How to Create and Set Up an EC2 Instance on AWS and Install IIS Web Server

Introduction
AWS Elastic Compute Cloud (EC2) is a powerful service for creating scalable cloud-based virtual servers. In this post, we'll show you how to create an EC2 instance and install the IIS web server on it. This is a simple method that even beginners may execute in a few steps.

Step 1: Go to AWS Console, create account and sign in

AWS Console

  • Login to the AWS Management Console.
  • Log in with your credentials. Step 2: On the dashboard search box type EC2 and click on EC2 console

search box write EC2

  • Scroll down and click on lauch instance

lauch instance
Configure the instance as follows:

  • Name and Tags: Provide a name for your instance and click on add additional tag.

Name and Tags

  • Explore the add additional tag

additional tag

  • AMI (Amazon machine image): Select Windows for this tutorial, like Windows Server.

Amazon machine image

  • Select the free Microsoft Windows Server 2025 Base from the dropdown menu as the Amazon Machine Image (AMI).
    Microsoft Windows server 2025

  • Instance type: Select a type (such as t3.micro for free tier instances).

t3.micro for free tier

  • Key Pair: Create a key pair for SSH access.

key pair

  • Give the key pair a name and choose the RSA and click on create key pair. Notice that the key pair is being downloaded

Give the key pair

-Network Settings: Scroll down to Firewall (security groups), then check and Ensure that RDP from anywhere and Allow HTTP from the internet are both ticked. This will ensure that your server may be accessible from anywhere on the internet.

Network Settings

  • Explore the other default settings under Advanced Details, and then click Launch Instance. Wait for the instance to launch successfully.

launch

lauching

  • Now, let's connect to the launched instance and install the IIS Web Server.

connect to instance

  • Go to the RDP Client tab, enable the "Connect using RDP client" option, and download the RDP file.

download the RDP file

  • Wait for the file to finish downloading, then click Get Password.

finish downloading

  • Click upload the private key file. Then find and choose the previously downloaded key file, then upload the private key file.

upload the private key file

  • Click on Decrypt Password to reveal the password.

Decrypt Password

  • Copy the displayed password.

Copy the displayed password

  • Open the downloaded RDP file and initiate the connection.

downloaded RDP

  • Paste the previously copied password into the prompt and click OK.

copied password

  • And just like that, your remote desktop is ready to use! šŸš€

remote desktop

  • To create an IIS web server, follow these steps: Locate PowerShell on the desktop and run it as an administrator.

PowerShell

administrator

  • Type the command Install-WindowsFeature -Name Web-Server -IncludeManagementTools and press Enter.

comman

  • Wait for the command to execute and complete the installation.

Wait for the command

Image description

  • Go back to the AWS Management Console after leaving the remote desktop. Copy the instance's public IP address upon selecting it.

Copy the instance's public IP

  • Paste the copied IP address into a new tab in your browser.

copied IP address

You should now see the IIS web server page, confirming that it has been successfully accessed from the public internet.

For tutorial purposes, to avoid using up your AWS credits, make sure to terminate and delete the instance immediately after use.

terminate

terminate

Conclusion
By completing these steps, you have successfully created an EC2 instance and configured it with an IIS web server. This configuration is a necessary step for hosting web apps on AWS. If you want to personalize your IIS or deploy applications, you can expand on this basic configuration.

Top comments (2)

Collapse
 
rdgmh profile image
Raphael Gab-Momoh

I like the fact that you added a conclusion and a termination for the instance. Well done!

Collapse
 
kosisochukwu_ugochukwu_a2 profile image
Kosisochukwu Ugochukwu

Thanks coach