How to create an elastic compute cloud 2 (EC2)(Microsoft Windows Server 2022 base) and connect with open SSH on PEM.
Published: 2023-04-06 13:02:37


![Happy Cloud Girl](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jsm34jibmfel4ietxn2a.gif)
Yaay!! Welcome you to my very first article. I am super excited to do this. 
So, I will be showing us simple steps to create, connect and terminate your own EC2 instance on an AWS cloud.
Leggooo!!!

**Step 1: Log in to your AWS Management Console and navigate to the EC2 dashboard.** 

![EC2 Dashboard](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e5brxdpxqw7m9pthd6z8.PNG)
By this, I'm sure you have already created your AWS account and are now logged into your account. Please click on the link below to signup if you haven't already.[click here to sign up](https://aws.amazon.com/console/)

**Step 2: Click on the "Launch Instance" button to start the instance creation process.**

![Launch instance](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cn9d159w0whz1qib0gvn.PNG)
**Step 3: Begin your instance configuration and choose an Amazon Machine Image (AMI) for your instance.** 
![instance config](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9266icqbz6kxkaii0jcb.PNG)Enter the name you want to give your VM, then choose the appropriate operating system for your machine. The AMI is essentially the operating system that your instance will run on.

**Step 4: Choose an instance type.**
![Type](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dp6271sfmlzu9281ttt6.PNG) This determines the hardware specifications of your instance, such as CPU, RAM, and storage. Usually, you just want to go for the free tier if you are just starting.

**Step 5: Configure the instance details, such as the number of instances, network settings, and storage options.**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ybr62ctfpjvugg5r2qge.PNG)
I usually leave things the way they are here by applying the default settings.

**Step 6: Select an existing key pair or create a new one to securely connect to your instance.**
![Keypair creation](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ij38ahkpmg44wm42bhak.PNG)
At the Keypair section, click on the right icon which reads, create new keypair- you can create your keypair by typing a name for it and selecting the .PEM option. This will come in handy later on so don't forget.

**Step 7: Review your instance details and launch the instance.**
![Final Launch](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d1lgovu6sdtjbywl8e8r.PNG)

**Step 8: Wait for your instance to launch, and then connect to it securely using the key pair you selected.**

![connection](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l4mld1t47voqm6urbtb6.PNG)
Now, your instance is up and running smoothly, make sure its selected or checked, then you click on connect on the upper tab to connect to your virtual machine.

**Step 9: connect to instance using RDP Client.**
![RDP Server](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xcwooil1k15odkuwug7b.PNG)
Once the connection tab opens, select the RDP client, click on get password and enter your .PEM keypair in the box shown.
**Step 10: Connection.**
![copy password](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8xda00xx1e4pendvk7ul.PNG)
Copy your password as generated in the public DNS, click on download remote desktop file, Open it, attach copied password on  the space for administrator password , connect.
**Step 11: Connection successful.**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qhqe6jta0gihboq168u9.PNG)
connect and load open your VM instance on your computer, VOILA!!

**TERMINATION OF INSTANCE**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kgu9ifpncmx340dbfc5d.PNG)
Essentially, there is need to terminate your instance when not in use to avoid accruing unnecessary charges. To do this go back to the launch instance terminal and terminate. 


**That's it! You now know how to create a fully functional EC2 instance running in the AWS cloud, connect successfully as well as terminate it.
**
ciao!