Web Server in EC2 Instance
In this article, I will show you how to create EC2 instance (Windows Server 2019) and then install web server in EC2 instance.
1- Log in to AWS account and then go to the AWS Services tab at the top left corner.
![aws management console](https://xpertstec.com/wp-content/uploads/2020/08/aws-management-console.webp)
2- Click on Launch Instance button.
![aws launch instance](https://xpertstec.com/wp-content/uploads/2020/08/aws-launch-instance.webp)
3- Select Windows Server 2019
![aws instance choose ami](https://xpertstec.com/wp-content/uploads/2020/08/aws-instance-choose-ami.webp)
4- Select an Instance type
Click Next : Configure Instance details
![aws choose instance type](https://xpertstec.com/wp-content/uploads/2020/08/aws-choose-instance-type.webp)
5- Number of instances – 1
Network – default.
Subnets – default
Auto-assign Public IP – Enable.
Click on Next : Add Storage.
![aws configure instance details](https://xpertstec.com/wp-content/uploads/2020/08/aws-configure-instance-details.webp)
6- Select Storage
Click Next : Add Tags.
![aws add storage](https://xpertstec.com/wp-content/uploads/2020/08/aws-add-storage.webp)
7- Tag – web server
Click on Next : Configure Security Groups
![aws add tags](https://xpertstec.com/wp-content/uploads/2020/08/aws-add-tags.webp)
8- Security group name – My Security Group
Select Protocols – (RDP, HTTP, HTTPS) and then select source anywhere
Click on Review and Launch
![aws configure security group](https://xpertstec.com/wp-content/uploads/2020/08/aws-configure-security-group.webp)
9- Review the instance details and parameters and then click launch.
![aws review instance launch](https://xpertstec.com/wp-content/uploads/2020/08/aws-review-instance-launch.webp)
10- Select Create a new key pair
Type a name for your key – Web Server
Select the download key pair button and save it in your secured folder
After downloading the key pair then click launch instance.
![aws download key pair](https://xpertstec.com/wp-content/uploads/2020/08/aws-download-key-pair.webp)
11- Select View Instances
![aws launch status](https://xpertstec.com/wp-content/uploads/2020/08/aws-launch-status.webp)
12- Instance status is running
Select the instance and then click connect.
![aws instance running](https://xpertstec.com/wp-content/uploads/2020/08/aws-instance-running.webp)
13- Click on Get Password.
![aws instance get password](https://xpertstec.com/wp-content/uploads/2020/08/aws-instance-get-password.webp)
14- Click choose file button.
![aws key pair path](https://xpertstec.com/wp-content/uploads/2020/08/aws-key-pair-path.webp)
15- Select the key pair you downloaded earlier and then click ok.
Click Decrypt Password.
![aws decrypt password](https://xpertstec.com/wp-content/uploads/2020/08/aws-decrypt-password.webp)
16- Copy the password and then select Download remote desktop file
![aws download remote desktop](https://xpertstec.com/wp-content/uploads/2020/08/aws-download-remote-desktop.webp)
17- Click Connect.
Paste the password and then click ok.
![remote desktop connection](https://xpertstec.com/wp-content/uploads/2020/08/remote-desktop-connection.webp)
18- Click yes
EC2 Instance (Windows Server 2019 desktop)
install a web server in EC2 instance
Install Web Server IIS
1- Server Manager, Dashboard and then select Add roles and features.
![sever manager](https://xpertstec.com/wp-content/uploads/2020/08/sever-manager.webp)
2- Add roles and features wizard click next.
![add roles and features wizard](https://xpertstec.com/wp-content/uploads/2020/08/add-roles-and-features-wizard.webp)
3- Install web server IIS installation, leave default Role-based or feature-based installation selected, and then click Next.
![role based or features](https://xpertstec.com/wp-content/uploads/2020/08/role-based-or-features.webp)
4- Server selection: Select server and then click next.
![select server from pool](https://xpertstec.com/wp-content/uploads/2020/08/select-server-from-pool.webp)
5- From the server roles, select the checkbox next to Web Server (IIS).
![select server roles](https://xpertstec.com/wp-content/uploads/2020/08/select-server-roles.webp)
5- A new window will popup that additional features are required, simply click the Add Features button to install these as well.
![add feature that required](https://xpertstec.com/wp-content/uploads/2020/08/add-feature-that-required.webp)
6- Click next.
![select server roles](https://xpertstec.com/wp-content/uploads/2020/08/select-server-roles-1.webp)
7- You can install any additional features at this stage by clicking next on the Select features window.
![server roles select features](https://xpertstec.com/wp-content/uploads/2020/08/server-roles-select-features.webp)
8- Web Server Role (IIS) window, click next
![web server role iis](https://xpertstec.com/wp-content/uploads/2020/08/web-server-role-iis.webp)
9- Install web server IIS, role services option you can install additional services for IIS if required. Click Next.
![server roles services](https://xpertstec.com/wp-content/uploads/2020/08/server-roles-services-1.webp)
10- Confirm installation selections, review the summary, and then click the Install button when you are ready to proceed with installing the IIS web server.
![confirm installation selection](https://xpertstec.com/wp-content/uploads/2020/08/confirm-installation-selection.webp)
12- No reboot should be required, however, if you remove the role a reboot will be needed.
![confirm installation selection results](https://xpertstec.com/wp-content/uploads/2020/08/confirm-installation-selection-results.webp)
13- Open the path in C drive (C:inetpubwwwroot) in notepad, rename it (this is Amazon Web Server), and then save it.
![windows explorer](https://xpertstec.com/wp-content/uploads/2020/08/windows-explorer.webp)
14- Select your Web Server Instance, under description copy public IP Address.
![aws instance running](https://xpertstec.com/wp-content/uploads/2020/08/aws-instance-running-1.webp)
15- Paste in web browsers.
![browser](https://xpertstec.com/wp-content/uploads/2020/08/browser.webp)