DEV Community

Cover image for Creating an EC2 instance on AWS and installing IIS web server on it.
Afeez Adeyemo
Afeez Adeyemo

Posted on

Creating an EC2 instance on AWS and installing IIS web server on it.

This tutorial demonstrates how to create an EC2 instance on Amazon Web Services (AWS) and installing IIS web server on it.

What is AWS
Amazon Web Services (AWS) is a comprehensive and widely used cloud platform with global reach that offers secured and cost-efficient cloud computing services i.e. Compute, Storage, Databases, Machine Learning, Networking etc. hosted in data centers located in various areas globally.

EC2 instance

An Amazon EC2 (Elastic Compute Cloud) instance is a virtual server in the AWS cloud environment. EC2 instances are secure and scalable and are used for a wide range of applications, including web hosting, data processing, machine learning, gaming, and more.

Below are the steps that will be used in this tutorial

Step 1: Sign in into AWS management console and create the EC2 instance.
Step 2: Connect to the instance.
Step 3: Create the IIS web server.

Step 1: Sign in into AWS management console and create the EC2 instance.

  • On google, search for AWS management console

AWS management console

  • Sign in into the console or Create a profile.

Sign in

  • Search for EC2 on the home page.

Search for EC2

  • scroll down and launch instance

launch instance

  • Give the instance a name, you can add other tags

name and tags

  • In the Application and OS Images, in the quick start tab, select an OS image for your instance. Select Windows for this tutorial.

OS image

  • Select the free Microsoft Windows server 2025 Base as the Amazon machine image

Amazon machine image

  • For instance type, select t3.micro

instance type

  • For key pair, Create new key pair

Create new key pair

  • Give the keypair a name, ensure key pair type is RSA then craete a key pair. Notice the keypair file is downloaded.

Key pair

  • Scroll down to Firewall (security groups), select Ensure RDP from anywhere and Allow HTTP from the internet are both selected. This will ensure your server can be accessed anywhere over the internet.
    • Launch instance and wait for it to be successful.

Launch instance

Step 2: Connect to the instance and create the IIS web server

  • Connect to instance

Connect to instance

  • Select the RDP Client tab, check the Connect using RDP and Download the RDP file

Download remote desktop file

  • Wait for the file to download. Select Get password

Get password

  • Upload private key file, navigate and select the key file downloaded previously.

upload private key

  • Decrypt password

Decrypt password

  • Copy password

Copy password

  • Open the RDP file that was downloaded

Open RDP file

  • Connect

Connect

  • Paste the password previously copied. OK

Enter password

Remote desktop

Boom here comes your remote desktop.

Step 3: Create the IIS web server

  • Search for PowerShell on the desktop, run as Admin

PowerShell

  • Enter the command Install-WindowsFeature -Name Web-Server -IncludeManagementTools. Press Enter

Coomand

  • Wait

Wait

Successful
Notice the Exit Code says successful

  • Exit the remote desktop to the AWS management console. Select the instance, copy the public IP address.

Copy public IP address

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

Paste IP address

  • Press*Enter* and observe the web server that was deployed

Web server

Notice the IIS web server was successfully accessed from the public internet.

  • To ensure you dont run out your credit on AWS, Terminate and delete Instance immediately after usage.

Terminate and delete instance.

I hope this was helpful. Please drop questions and comments in the comment session

Top comments (2)

Collapse
 
jatinmehrotra profile image
Jatin Mehrotra

Good article. Good for people who are starting with Ec2 instances

Collapse
 
tjasper profile image
Oluwaloseyi Oluwatofunmi Emmanuel

Great resource! Thanks for sharing