User Tools

Site Tools


Setting up your Amazon EC2 instance

Visit Amazon Web Services and create an account

You will have to put credit card details in, but you won't be charged for your first year if you select a product in the free tier (the free tier has an adequate server for what we'll need).
Get logged in to the AWS site to you see your username beside the bell icon. When logged out, hit the orange button “Sign in to console”

  • In the top-right of the nav bar left of “Support” is a region, click this to change your region to EU e.g. Ireland
  • In the top-left of the nav bar click Services then EC2, or search for EC2 in the search bar.
  • Click Launch Instance
  • Select Ubuntu Server 18.04 LTS, 64-bit (x86)
  • Choose the General Purpose t2.micro option (it should say “Free tier eligible” in green)
  • Click Review and Launch, then Launch

It may take a few minutes for Amazon to approve your launch request
You'll be asked to set up a key pair and save it to your machine. Select Create a new pair and hit Continue. It's important you don't lose this file or you'll lose whatever is in your EC2 instance and will have to launch a new one.
I have a video here that takes you through it. Only the first 3 minutes or so are relevant. Remember to change your server location to Europe/London.
Now we should add security rules so when we make the web pages they will be accessible by anyone with a browser.


In the navigation pane choose Security Groups. Select Create Security Group.
Give it a name and a description.
Click Add Rule.
Enter the following rule settings:

Protocol TCP
Port range 80
Source anywhere

Click Create.

Then we need to assign that rule to our server instance.
Back in the side menu select Instances.
Tick your instance.
Go to Actions > Networking > Change Security Groups.
Tick your security group and Apply.

You should now be able to connect to your instance.

On Mac/Linux

Mac and Linux systems have built in OpenSSH tools to connect to your server. First find the private key you received ending .pem. Open Terminal and move it to your SSH folder, create it if it does not already exist

mv ~/Downloads/<key>.pem ~/.ssh

Add the key to your authorisation agent

ssh-add <key>.pem

SSH in to the server

ssh ubuntu@<your_server_ip>

Find your server’s IP in the AWS console (you may need to scroll sideways)

On Windows

There are some extra steps needed to convert your PEM file to something compatible with PuTTY if you are using Windows. There are some instructions for that here:

Download putty here:
For simplicity, download the executables under “Alternative binary files”
The main program “putty.exe” 32-bit
And the key converter utility “puttygen.exe”
The MSI installer is more customisable but fiddly.
Another video guide to both converting and connecting
Now move on to the next set of instructions to set up a web and database server.

To find out more about a command you can read its manual pages

man ssh

More information on the command line

setting_up_ec2.1562764830.txt.gz · Last modified: 2019/07/10 14:20 by ed