Host Static Website on EC2 Windows IIS Server

INTRODUCTION

This guide walks you through launching a Windows Server EC2 instance using the AWS Free Tier, connecting via RDP, and setting up IIS to host a basic web page.

  • AWS:- Amazon Web Services (AWS) is a leading cloud computing platform that provides on-demand services like computing, storage, databases, networking, and security. It enables businesses to build and scale applications without maintaining physical infrastructure.

  • IIS:- IIS (Internet Information Services) is a web server developed by Microsoft for hosting websites and web applications on Windows Server. It supports various protocols, including HTTP, HTTPS, FTP, and SMTP, making it a powerful platform for web hosting.

RESOURCES:-

πŸ”Ή EC2 (Elastic Compute Cloud) – A cloud-based virtual server provided by AWS for running applications. It allows users to launch, configure, and manage scalable computing capacity.

πŸ”Ή RDP (Remote Desktop Protocol) – A Microsoft protocol that allows users to remotely access and control Windows-based computers or servers over a network.

πŸ”Ή HTTP (HyperText Transfer Protocol) – A protocol used for communication between web browsers and servers to load websites. It operates over port 80 (unencrypted).

πŸ”Ή Security Group – A virtual firewall in AWS that controls inbound and outbound traffic for EC2 instances based on defined rules (e.g., allowing RDP, HTTP, or SSH access).

πŸ”Ή HTML (HyperText Markup Language) – The standard language for creating web pages, using elements like <h1>, <p>, and <a> to structure content.

Step1: Launch a Windows Server EC2 Instance

  • Log in to the AWS Console

    • You can go to the AWS Management console.

    • Navigate to the EC2 dashboard under "Compute”.

  • Launch an EC2 Instance

    • Click Launch Instance.

    • Give Names and tags

    • Choose an Amazon Machine Image (AMI):

      • Select Microsoft Windows Image.

  • Choose an Instance Type:

    • Select t3.micro (free-tier eligible).

  • Key pair login:

    • Create a new key.

  • Configure Security Group:

    • Create a new security group with rules:

      • RDP (3389, TCP, Anywhere or your IP).

      • HTTP (80, TCP, Anywhere) – Required for web hosting.

  • Review and Launch:

    • Click Launch.

  • Now click on successfully.

  • Connect the Instance.

  • Click Connect.

    Step 2: Connect to the Windows EC2 Instance via RDP

    1. Retrieve the Administrator Password

      • Click RDP Client.

      • Download the remote desktop file.

      • Click Get Password.

      • Upload your key pair (.pem) file and decrypt it.

      • Open the downloaded remote desktop file.

      • Connect it.

      • Copy the password and paste it.

      • Click on yes.

      • It will give you access to a virtual Windows machine.

        Step 3: Install and Configure IIS (Internet Information Services)

        • Open Server Manager β†’ Add roles and features.

        • Select add Role and features.

        • Click on next.

        • Select Role-based or feature-based installation.

        • Next.

        • Choose Web Server (IIS) and click on Next.

        • Click on Add Features.

        • Select IIS Hostable Web Core.

        • Next.

        • Select Web Server.

        • Select all Common HTTP Features.

        • Next.

        • Install.

        • Navigate to File Explorer, select "This PC," and then open the "Windows" folder.

        • Navigate to the β€œ inetpub ” folder and then select the β€œ wwwroot folder ”.

        • Delete the default folder which is already present in the folder.

        • Next, click on "New," and then select "Text Document."

        • A new text document has been added.

  • Please follow the highlighted steps that are visible in the image below.

  • Paste the below code in Notepad and save it as an index.html extension

  • Double-click on the index.

  • The index file will prompt you on the website page which is shown in the below image.

Happy learning!

0
Subscribe to my newsletter

Read articles from Shreiya Chintalwar directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Shreiya Chintalwar
Shreiya Chintalwar