A Free EC2 Cloud Server With Ubuntu, Jenkins And Sonar.

DZone 's Guide to

A Free EC2 Cloud Server With Ubuntu, Jenkins And Sonar.

· Cloud Zone ·
Free Resource


This example shows you how to create a free Amazon EC2 cloud based continuous integration and testing environment on Ubuntu. 

This is a low power server but it is useful for infrequent use. I personally tend to recommend Cloudbees,  but this is handy when you need a free Sonar instance.

You can see it used here


The steps are very simple

  • Sign up for a 1 year free account from Amazon
  • Create a new server from an existing image with Hudson and Sonar.

Viewing The Final Platform

You can see an example of the finished platform by clicking on the links below.

Creating A Free Amazon Account

Amazon offer a free account for new customers. First sign up for the account at the following link.


Creating A Free Server

Launch The Console

The free account only allows you to use a restricted set of images and a micro server.

Follow the steps below to create the server.  The first step is to log into the main Amazon console.  


Go to the EC2 Tab and Click 'Launch Instance'


Select an Image

Next we have to choose the correct image which contains Ubunto sonar and Jacoco. 
Go to the community tab and look for the following image.


Notice the 'Star' which shows it is free tier eligible if chosen with a Micro Instance.

Select a Micro Instance.

You can choose the size of the type of server in the next screen.  We want a Micro Instance which is free. 

Notice the type 'Micro (t1.micro, 613MB). Leave the defaults and click on 'Continue'

Again leave the defaults and click on continue.

Advanced Instance Options

Leave the defaults and click on continue.

Instance Properties

Leave the defaults and click on continue.

Create Key Pair

This key pair is important because it is needed to connect to your server. 

Click on the 'Create & Download your key pair'.  Keep the file safe.

Creating A Security Group

The next screen allows you to define the firewall rules for your server.  

We are going to allow all of the following rules below.  You can make it more restrictive if you like once everything is running.

Instance Details.

The details of your new server will then be summarised. 

Click on 'Launch' to start the server.

Tools to connect to your Server

You will probably be curious to see what is happening on your new server and want to connect to it.

To do this download and install putty. This will give you all the tools you need to connect to the server.


Converting Your Security Key

Before you can use putty to login you need to convert the .pem key from step 1 to a .ppk key.

Go to your installation of putty and run puttygen. Select load and choose your downloaded .pem file.  

You should see the dialog below.

Next click on 'Save Private key' and save the file somewhere safe.

Connecting To your Server

First run putty and fill in the in the server name

Next click on the SSH -> Auth property.  Browse to the new .ppk file and select it.

Then click open. This should give you a terminal window asking who you want to connect as.

type 'ubuntu'

You should then see yourself logged in.



Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}