On this tutorial i’ll explain how to install Ubuntu on a Amazon EC2 Instance.
This tutorial applies to any of the EC2 Ubuntu Instance types and could be used a starting point to install other OS.
Creating a Amazon EC2 Ubuntu Instance
- Click on Launch Instance
- Quick Start
- Select Ubuntu Server 12.04 LTS
- On instance Details leave the default options or change accordingly to your liking.
- Advanced Instance Options: leave all default options and make sure select “Stop” as the default Shutdown Behavior . ( You can also enable the Termination Prevention to protect you against accidental termination.) Click Continue.
- Storage Device Configuration: Change accordingly to your liking or leave all options with default settings. Click Continue
- Key: Change accordingly to your liking or leave all options with default settings. Click Continue
- Create a Key Pair:
- Enter a name for you private key pair
- Click on Create & Download your key pair (save it on your desktop and don’t lose it), Click Continue.
- Configure Firewall
- Choose a name for your security Group. IE: WebServer or Public, and add a description to it..
- As you will note that only port 22 is open (needed to connect via SSH).Click Continue
- Click Launch, To launch your new instance.
- After you launch your instance, the instance wizard can be closed.
Assigning a Elastic IP to the created instance
- Click on elastic Ips
- Hit the button “Allocate New address”, on the popup windows Allocate the new address on EC2 and click YES allocate.
- Select the allocated ip address and click on Associate Address
- Associate the address with the instance you just created
Connecting to your newly created EC2 instance.
Download a SSH client, I prefer Putty witch is a free ssh client. You can download it from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
PuTTY is a free SSH client for Windows. PuTTY also comes with PuTTYgen, a key generation program, and pscp, a secure copy command line tool. This guide outlines the additional steps required to use PuTTY with Amazon EC2.
Before we can connect to our ec2 instance, there are some steps that needs to be done… we need to convert the Amazon KeyPair to a format our ssh client can read.. Putty read the PPK format
Converting the KeyPair
- After you install Putty, Open Puttygen
- Click on Load
- Choose to view all file types and select your download KeyPair, Click Open
- You will receive a notification that puttygen successfully imported the key….Click Ok
- You need to save the key in PuTTY’s format. You can either either use the File -> Save menu option or click on the Save private key button.
- Save the key as ppk format (default)
- Confirm saving the key without a passphrase. * ( For extra security you should add a passphrase to secure your Key)
Connect to our Instance with Putty.
This section assumes that you have converted an Amazon EC2 generated private key file to a PuTTY private key file and have successfully launched an instance.
- Run Pageant and on the graphical configuration utility. click on Add key and select the PuTTY private key file you generated earlier.
- The key will appear on the Pageant
- Open Putty and type your Elastic IP addres
- Type ubuntu as the user name (root user wont work on Ubuntu Instance)
- You wont need a password..