How to connect to Amazon EC2 Instance using PuTTY?


In this post, I will tell you what is PuTTY and Amazon EC2 instance and how to connect to Amazon EC2 Instance using PuTTY.

What is PuTTY?

PuTTY is open source SSH and telnet client software that allow you to remotely connect to your Amazon EC2 instance to install / update operating system, software, package, and so on.

What is Amazon EC2 Instance?

Amazon EC2 instance is the varying combinations of CPU, memory, storage, and networking capacity that allow you to run your websites.

The best part of the Amazon EC2 instance is that it will allow you to scale your resources to the requirements of your target workload.

Required Tools

To connect to Amazon EC2 Instance using PuTTY, you need 2 tools

  1. PuTTYgen - To convert your .pem file to .ppk file. Because PuTTY accepts .ppk file only.

  2. Filezilla - To access EC2 instance Remotely.

Download PuTTYgen

Download PuTTYgen (Mine is windows 32-bit).

Download PuTTYgen Page

Download PuTTY

Download PuTTY (Mine is windows 32-bit).

Download PuTTY Page

Convert .pem file to .ppk file

To Convert your .pem (that you created when you launched the instance) to .ppk. Do the following:

  1. Open PuTTYgen and click on the 'load' button.

    PuTTYgen Software Screenshot
  2. Change the file type to 'All Files(".")' and locate your .pem file.

    PuTTYgen locate file
  3. Click on your .pem file. Now, the PuTTYgen Notice dialog box appears, click on the 'OK' button.

    PuTTYgen Generate ppk file
  4. Now, click on the 'Save private key' button.

    PuTTYgen Save Private Key
  5. Now, the PuTTYgen Warning window appears, click on the 'Yes' button to save your key file without a passphrase to protect it.

    PuTTYgen Warning Pop up Window
  6. Type the ppk file name of your choice and click on the 'Save' button.

    PuTTYgen Type .ppk file name
  7. Hurry! you have converted your .pem file to .ppk file successfully.

    PuTTYgen final output

Setting up PuTTY

Now we will set up PuTTY to access your EC2 instance. To do so, please follow these steps:

  1. Open up PuTTY

    PuTTY window
  2. Find your Host Name in your 'AWS Management Console' by clicking on the 'connect' button in your Instances page.

    Find EC2 Host Name
  3. The 'Connect to your instance' pop up appears. Copy the Host Name starting from '@'.

    My Host name is ''

    Copy EC2 host name
  4. Now paste the copied host name to the PuTTY.

    Paste EC2 instance Host name
  5. Now click on the 'Data' menu under 'Connection' section in the left side menu.

    PuTTY Open Data section
  6. To fill the Auto-login username, find your user name from your 'AWS Management Console' by clicking on the 'connect' button in your Instances page.

    Ec2 Connect Button
  7. Copy your EC2 instance 'username'. In most cases your username will be 'ubuntu'.

    Copy EC2 User Name
  8. Paste your username in the 'Auto-login username' input box of PuTTY Configuration.

    Paste EC2 User Name
  9. Expand 'SSH' menu under 'Connection' section on the left side menu.

    Expand PuTTY SSH
  10. Click on the 'Auth' menu under 'SSH' section and locate your myKey.ppk by clicking on the 'Browse...' button.

    PuTTY Auth Menu
  11. Move to 'Session' section in the top of the left side menu and do the following:

    1. Type the session name of your choice.
    2. Click on the 'Save' button.
    Save PuTTY Session
  12. PuTTY Configuration is over. To Connect to your EC2 instance via PuTTY. Do the following:

    1. Open PuTTY
    2. Click on your Saved Sessions Name
    3. Click on the 'Open' button
    open saved PuTTY session
  13. Hurray! PuTTY is connected to your EC2 instance.

    Note: If your PuTTY is not connecting automatically. Please type your username ('ubuntu') manually or delete the saved session and reconfigure your PuTTY will fix it for you.

    PuTTY connected to your EC2 instance

Related Post

How to Deploy Node.js App in EC2 instance?

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author