How to Create your First EC2 Instance and Connect using PuTTY

Archita Joshi
5 min readJul 22, 2021

What is EC2?

EC2 stands for Elastic Cloud Compute. Amazon Elastic Compute Cloud (Amazon EC2) provides scalable computing capacity in the Amazon Web Services (AWS) cloud.

What is an Instance?

Amazon EC2 provides different instance types to enable you to choose the CPU, memory, storage, and networking capacity that you need to run your applications. For simple, Instance is an operating system and hardware configuration which you select as per your need.

What is PuTTY and PuTTYgen?

PuTTY is an SSH client, which allows you to remotely log into other computers (as long as they’re configured to let you do that). It’s a very useful tool for system administrators.

PuTTYgen is a program that can generate SSH key pairs, which are special files you can use for encryption, authentication, and so on. The two programs aren’t strictly related, but PuTTY can use SSH keys.

Now let’s create an EC2 instance and access it using putty.

Step 1: Open your EC2 Console: https://console.aws.amazon.com/ec2/

Step2: Click on Services and select EC2.

Select EC2

Step 3: Click on instances running. You can see that the count displaying there will be ‘0’ if any instance is not running on your machine.

Step 4: Now select the launch instances tab from the right corner to configure and launch an instance.

Step 5: Now select the Amazon Linux machine. You can select any other machine also which is eligible for free tier account.

Step 6: Leave the further settings as it is and select Next: Configure Instance Details.

Step 7: Now you can select the number of instances you want to launch. For now we will leave it as default setting and click on Next: Add Storage.

Step 8: Now select Add Tags.

Step 9: On the next page, select add another tag. You can select any key and value. I have written key as ‘Name’ and value as ‘Linux’. After that click on Next: Configure Security Group.

Step 10: In the security group, select the source and change it to ‘Anywhere’. So now you can access the machine from anywhere. You can also add a new security group. In my case, I have left it as default. Next click Review and Launch.

Step 11: Your instance is ready to be launched. Click on the launch button in the right bottom.

Step 12: Now we have to create a key pair to access our machine. Hence, select on Create a new Key Pair write a key pair name and download it. Here I have taken key pair name as Linux_Test123. After that select launch instances.

Step 13: Now the instance is launched and you can view it by selecting View Instances tab. Once the instance state of the machine turns to running, you can now access it through PuTTY.

Step 14: For access it through PuTTY, first open the website https://www.puttygen.com/download-putty and download PuTTY and PuTTYgen specific to your Operating System. After that copy the public IP address of your linux machine and open PuTTYgen.

Step 16: Click on load and select the key pair which we had downloaded before. After successfully importing that a pop-up menu will appear. Select Ok.

Step 17: Now select the Save private key tab and save the ppk file on your desktop. This will be the be the access key for PuTTY.

Step 18: After this open the PuTTY executable and paste the IP address which was copied before. Now expand SSH and select Auth. Browse through your PC and select the ppk file which was generated using PuTTYgen. After that select open and your Amazon linux EC2 instance is ready.

Step 19: Type ec2-user to login as ec2 user and your machine is ready to perform whatever operations you want.

Make sure to close the command line interface and to stop the server from AWS Management Console after the work is done.

Do like and share :)

--

--