Hosting your Website using Window EC2 Instance in AWS

Harshith Shetty
5 min readMar 29, 2021

In this article, we will see how to launch the windows Instance and host our Website on the cloud using it.

All the cloud services Provider provides various services to host your website in their cloud. For this article, I will concentrate on the AWS Cloud Service provider and its service. For Hosting your Website AWS provides services such as EC2 instance (will we concentrate on Windows)

Before Starting The Hosting of your Web site First, let’s be ready with our Code. For website content and code, I am going to just use the Templates, which are available online for free. You Can download the template from the Freebiesbug. For this article I have used the Hook: A dark HTML landing page template.

Download the Code of the template, extract it, and create a git repository. Now we will start the hosting.

Hosting On Window EC2 Instance :

You can host your website on the cloud using EC2 instance by following the few steps :

Step 1: Launch the Window Ec2 Instance

Go to AWS console and search For EC2 and then Select Launch Instance option in Instance.

To launch the Ec2 Instance, there are total 6 steps
1. Choose AMI
2. Choose Instance Type
3. Configure Instance
4. Add Storage
5. Add Tags
6. Configure Security Group
7. Review

  • Since we want to host our Website in window Instance so we will select the Microsoft Windows Server 2019 Base AMI. you can also select other window instance if you wish to.
  • Choose an Instance Type as t2.micro, it is sufficient to host a static website and also include in the free tier.
  • In configure Option, select your VPC in network option. If you don’t have an VPC, create the VPC in VPC management Console and leave rest of the option a default.
  • by default it will allot you with 30GB EBS for snapshot leave that as it because that is sufficient for our hosting.
  • For tags you can add it or else it is fine for hosting setup.
  • In Security Group, create a security group and add RDP, HTTP and HTTPS Rules or else if you have an existing Security Group with this 3 rules you can use that. RDP — it is used to connect the Windows server remotely from your device. HTTP & HTTPS is used to deliver data of our web to the world wide web.
  • In review section, you can see all the setting of the EC2 instance once you have confirmed with setup click on Launch button. It will ask to Create security Key (.pem) or use the existing one you can create by just giving it a name and download it. Keep the security key safe with you.

Now we have launched the instance. Now it's time to connect.
Go to Instance details and Select Connect

Then Download The RDP client So that you can connect it directly.

You can see that we got the username, but for the Password we have to create it by using the Security key
Click on Get Password

Upload the Security Key and Click on the Decrypt Password and

Now you can see the username and password as well

Open the RDP file and use the username provisioned and password that we decrypted from the security key.
Now you could see your window server just like your desktop.

Now install XAMMP

after Installation Now let add our webpage code to the proper file so that xammp can host it of us.
Insert the Codes of the page Inside xammp > htdocs Folder

After adding the files now let start the xammp, Start Apache and MYSQL

Now you would see that xammp is doing its work, but still you cannot see the website using Public IP Address that is because of the firewall to remove Public Inbound Firewall.
Search Window Defender Firewall with Advanced Security and open it.

just click window Firewall Properties inside the Overview Section and allow the public Inbound traffic.

Now Search the Public IP address in browser you would be able to see your website.

--

--

Harshith Shetty

Aspiring Cloud Architect. Learning and Exploring Cloud Services.