AWS Free

Using R on Amazon EC2 under the Free Usage Tier

  1. Go to the homepage for Amazon Web Services, ‘’. Sign up by clicking the ‘Sign Up Now’ button on the right.

C:\Users\Kevin\Desktop\Jing photos\Cloud\

  1. Create a new Amazon account, or log in to an existing account.

C:\Users\Kevin\Desktop\Jing photos\Cloud\

  1. You will need to provide credit card information, even if you only plan on using the Free Usage Tier.

C:\Users\Kevin\Desktop\Jing photos\Cloud\credit.card.png

  1. Provide a telephone number. You will be called and given a PIN number which will be used to verify your identity. When this step is finished, you have an account. Click ‘Continue’ to go back to homepage. Log in to AWS by clicking the ‘Sign in to the AWS Management Console’ link on the homepage.
Introduction to AWS CLI

C:\Users\Kevin\Desktop\Jing photos\Cloud\pin.png

  1. You are now in the AWS Management Console. Under the ‘EC2’ (Electronic Cloud Computing) tab, click the ‘Launch Instance’ button.

C:\Users\Kevin\Desktop\Jing photos\Cloud\ec2.launch.png

  1. Choose an instance. Starred instances are free (part of the Free Usage Tier). Select the ‘Basic 64-bit Amazon Linux AMI 2011.02.1 Beta’.

C:\Users\Kevin\Desktop\Jing photos\Cloud\quick.start.png

  1. Next, specify ‘Instance Details’. Keep all defaults. (Note: the Free Usage Tier is for Micro Instances only.) Click ‘Continue’ at successive screens.

C:\Users\Kevin\Desktop\Jing photos\Cloud\micro.type.png C:\Users\Kevin\Desktop\Jing photos\Cloud\advanced.opt.png

Provide a descriptive name for this Instance (here, ‘Micro Instance with R Self Build’). Click ‘Continue’.

C:\Users\Kevin\Desktop\Jing photos\Cloud\name.png

  1. Create a new Key Pair. Provide a name for the new key pair (here, ‘newkey’). Click ‘Create & Download your Key Pair’.

C:\Users\Kevin\Desktop\Jing photos\Cloud\create.key.png

  1. Create a new Security group. Port 22 should already be selected. Add a Group Name (here, ‘basic’) and Group Description (here, ‘22 open for SSH’). Click ‘Continue’.
How to check users, roles and privileges in Oracle

C:\Users\Kevin\Desktop\Jing photos\Cloud\security.png

  1. The Instance is now launching. Click ‘View your instances on the Instances page’.

C:\Users\Kevin\Desktop\Jing photos\Cloud\launch.finish.png

  1. If using a Windows machine, you will need to SSH (secure shell) to your Amazon EC2 instance using a free tool called ‘PuTTY’. Go to the PuTTy homepage at Click ‘putty.exe’ and ‘puttygen.exe’ to download the necessary binaries.

C:\Users\Kevin\Desktop\Jing photos\Cloud\putty.downloads.png

  1. Open ‘puttygen.exe’. Go to the ‘Conversions’ tab and select ‘Import Key’. Search for and select the key pair created in step 9 (named ‘newkey.pem’). Click ‘Save private key’ (here, this is saved as ‘newkey.ppk’). You will be prompted to add a passphrase; it is not mandatory to add a passphrase.

C:\Users\Kevin\Desktop\Jing photos\Cloud\putty.gen.png C:\Users\Kevin\Desktop\Jing photos\Cloud\save.private.key.png

  1. Open ‘putty.exe’. On the left, navigate to ‘Connections/SSH/Auth’. In the ‘Private key file for authentication’ field, browse to the location of the saved key (here, ‘newkey.ppk’) from the last step. Next, on the left, navigate to ‘Session’. In the ‘Host Name for IP address’ field, enter the Public DNS (Domain Name System) from your AWS management console (see detailed instructions below on how to find the Public DNS). Click ‘Open’.
AWS Lambda using Python

C:\Users\Kevin\Desktop\Jing photos\Cloud\find.private.key2.png C:\Users\Kevin\Desktop\Jing photos\Cloud\add.ip.png

To find the Public DNS, go to your AWS management console as shown below. Check the box to the left of the newly created instance (here, named ‘Micro Instance with R Self Build’ in Step 7). Details, including the Public DNS, will display. Copy this to the ‘Host Name for IP address’ field shown above, right.

C:\Users\Kevin\Desktop\Jing photos\Cloud\find.public.dns.png

  1. Click ‘Yes’ when the following box displays as this will be the first time logging into this server.

C:\Users\Kevin\Desktop\Jing photos\Cloud\security.alert.png

  1. Log in using the default user for the instance, ‘ec2-user’. You are now in the Cloud.

C:\Users\Kevin\Desktop\Jing photos\Cloud\finish.png

16. To install R inside the Cloud, type the following lines of code.

Getting started with AWS Lambda

C:\Users\Kevin\Desktop\Jing photos\Cloud\code1.2.png

Whenever prompted with ‘Is this ok [y/N], enter ‘y’.

C:\Users\Kevin\Desktop\Jing photos\Cloud\code2.png

C:\Users\Kevin\Desktop\Jing photos\Cloud\code3.png

The line ‘sudo make’ will take about 30 minutes to run.

C:\Users\Kevin\Desktop\Jing photos\Cloud\code4.png

The next line let’s you see if everything worked correctly.

C:\Users\Kevin\Desktop\Jing photos\Cloud\code5.png

C:\Users\Kevin\Desktop\Jing photos\Cloud\r.version.png

Open R by typing ‘R’, and you are ready to use R in the Cloud.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.