DEV Community

Cover image for How to create and connect to a Windows EC2 instance in AWS
Ayomide
Ayomide

Posted on • Updated on

How to create and connect to a Windows EC2 instance in AWS

In this post, I will be taking us through how to create and connect to a windows EC2 instance in AWS.
We first have to create an AWS account and connect to the AWS console. You can create an AWS account using this link

Launching and configuring the instance
Navigate to the EC2 console and click on launch new instance. Follow the following steps to setup your instance.

Enter a name for your instance
Selection of instance name

Under select amazon machine image(AMI) select microsoft windows instance, it has a free tier eligible version
Selection of AMI

You can choose to create a new key pair if you do not already have one. please note that you will not be able to connect to the windows instance using the remote desktop protocol(RDP) if you choose to continue without a key pair
Creation of keypair

Under network setting, make sure that your instance security group allows RDS traffic as it would be impossible to connect to the instance using RDS if the security group rules are not updated
Network and security group setting

Leave the other settings as default and proceed to create your instance. Once your instance has been provisioned, wait for it to be in a running state.

Connecting to the instance
We will now try to connect to our instance. Select your instance and click on the connect bottom located at the top of the screen
Instance information

Select remote desktop protocol as your mode for connecting to the instance. Download your remote desktop file and select get windows password
Connecting to instance using RDP

This will direct you to a new window where you will upload the pem file that was downloaded to your local computer when you created a new keypair. After uploading your file, click on decrypt password
Decrypting image

This will take you back to the previous page but your password would have been decrypted
Showing decrypted password

Open the RDP file you downloaded to your system, this will prompt you to enter your password so that you can connect to your windows instance
Connecting to windows instance prompt from RDP file

You might get a pop-up that the security certificate is not trusted. Agree to connect despite the unknown security certificate
Certificate not trusted pop-up

This will start the connection process and you should soon be connected to your instance as shown below
Connected to instance

Cleaning up resources
It is always best practice to clean up resources not currently in use to reduce costs. After disconnecting from your instance, navigate to the EC2 dashboard on your AWS console and select running instances. Click on terminate instance from the instance actions dropdown.
Termination and cleaning up of resources

Top comments (1)

Collapse
 
chymee profile image
Amadi Chimeremma

nice!