Setup Virtual Machine on AWS For Free

How to Setup Virtual Machine on AWS (Amazon Web Services)

What is  AWS?

  1. Amazon Web Services (AWS) is the IT division of Amazon
  2. It is the world’s most comprehensive and broadly adopted cloud platform, 
  3. It offers over 175 fully featured services from data centers globally. 
  4. Millions of customers—including the fastest-growing start-up’s, largest enterprises, and leading government agencies—are using AWS to lower costs, become more agile, and innovate faster.
  5. AWS is free for 1 year with fix no of hours usage

Setup AWS Free Account

You can Signup to AWS free edition from link
  1. Fill all your details
  2. Select Basic Plan
  3. Then login to console

Now Login @  

Create EC2 Cluster

I will click on option new EC2 Instance

Search for EC2 (Elastic cloud computer)

EC2: It is defined as elastic cloud compute, its same as virtual machine but it is on amazon cloud, accessible over internet.

 On EC2 Dashboard, scroll down and click Launch instance.

Select Ubuntu server (Below that please verify if its free)

Search for Type t2.micro  (You will see green color label Free for eligible)

Update Details in wizard

  1. Configuration
  2. Storage
  3. Tags




Setup AWS Security Group

Select below options 
  • Create a new Security group
  • In Type Select ‘All Traffic”
  • Leave rest as it is and go to Launch Instance

AWS Download Key Pair

On Launch, You will get important step for Key Pair. Select “Create a new key Pair”

Then Download it. If you miss then you will not get this option again.

Once Download done then launch

Launch AWS

Now cluster is created, You should click on view instances

Your Instance is ready

If you want to stop or terminate which is good practice after us  stop \ terminate the server  (right now leave it running)

Setup SSH Windows ec2

Documentation is available here for reference: 

Now we need, 

  • Instance id and Public DNS  (copy from  AWS console)
  • Private key (You have downloaded .pem file while creating instance)
  • Enable Inbound SSH traffic: we have already enable for all in previous steps

Download Putty: 

Convert your private key using PuTTYgen

  • PuTTY does not natively support the private key format for SSH keys. 
  • PuTTY provides a tool named PuTTYgen, which converts keys to the required format for PuTTY. 
  • You must convert your private key (.pem file) into this format (.ppk file) 
  • Run downloaded file "PuTTYgen.exe".
  • Under Type of key to generate, choose RSA. 
  • Choose Load. 

By default, PuTTYgen displays only files with the extension .ppk.

To locate your .pem file, choose the option to display files of all types.

  • Select your .pem file and choose Open. 
  • PuTTYgen displays a notice that the .pem file was successfully imported. Choose OK.
  • To save the key in the format that PuTTY can use, choose Save private key. 

PuTTYgen displays a warning about saving the key without a passphrase. Choose Yes.

A passphrase on a private key is an extra layer of protection. Even if your private key is discovered, it can't be used without the passphrase. 

The downside to using a passphrase is that it makes automation harder because human intervention is needed to log on to an instance, or to copy files to an instance.

Specify the same name for the key that you used for the key pair (for example, my-key-pair) and choose Save. PuTTY automatically adds the .ppk file extension.

Your private key is now in the correct format for use with PuTTY. 
You can now close putty key generator and connect to your instance using PuTTY's SSH client.

Start PuTTY (from the Start menu, choose All Programs, PuTTY, PuTTY).

In the Category pane, choose Session and fill

  • Host Name box: Enter my-instance-user-name@my-instance-public-dns-name.  (ubuntu@publicdns)
  • Ensure that the Port value is 22.
  • Under Connection type, select SSH.
  • To connect to your instance using PuTTY

In the Category pane, expand Connection, expand SSH, and then choose Auth. Complete the following:

  • Choose Browse.
  • Select the .ppk file that you generated for your key pair and choose Open.
  • If this is the first time you have connected to this instance, PuTTY displays a security alert dialog box that asks whether you trust the host to which you are connecting.
  • Choose Yes. A window opens and you are connected to your instance.

Now you are connected with AWS ubuntu instance.

You can verify that while running command hostname we got  instance private DNS 

If you want to setup Spark engine to run machine learning code on AWS EC2 , Click here

If you want to setup Spark engine to run machine learning code on local machine windows 10 , Click here

No comments:
Write comments

Please do not enter spam links

Meet US


More Services