How to set up an Ubuntu Server on Amazon EC2

If you have ever dreamed of having your own server, then I have good news. It has never been easier! In this tutorial I will discuss why you actually want to have your own server, how to setup your own Linux (Ubuntu) Server in less than 10 minutes and how to do this for free!

Why would you need your own server?

A dedicated server with root access opens a whole new world of applications, even if you are just browsing the internet. Here are some use cases:

1. Webserver – If you are hosting a website, it might be a good idea to move it to your own host, where you have full control.

2. Code / file repository – If you are going to collaborate with colleagues or friends on a project, it is crucial to have a common file repository. I’ve been using Subversion (SVN) for a long time, and it has proofed to be a viable partner.

3. Save Internet browsing – Is the local WiFi network at your favorite coffeehouse encrypted? If not, I recommend to route all your traffic through a Virtual Private Network (VPN). If you have your own server, it’s quite easy to set up a VPN.

4. Streaming Netflix – Are you outside the United states? No problem – you can route the traffic from US based server through the VPN connection to your Computer, TV or iPhone, wherever you physically are.

5. Experimentation – instead of installing your stuff locally into Virtual Machines, try a server. With Amazon EC2 it’s faster and more convenient.

These are just a few examples, to give you an idea about what you can do with your own server. Of course, the application of it is just limited to your imagination!

Why Amazon EC2?

Amazon has not only emerged from a bookseller to a wholeseller,  it has also created one of the world’s most powerful IT infrastructures in order to deliver it’s own content in a fast & responsive way. Fortunately, Amazon has decided to sell these IT services to the public, as well. The are called Amazon Web Services (AWS) and consist by today of a wide variety of different services. For example, all the mp3 files of my podcast are stored and delivered through Amazon Simple Storage Service (S3). Another service is Amazon’s Elastic Cloud Computer (EC2), which makes it really easy to create a virtual Server. Within a few mouse-clicks you can add almost infinite hard disk space or multiply the amount of CPUs, as you like (and as you can pay) ;-)

Best: During the first year, a microinstance is with 10Gbyte of Harddisk is completely free!

All you have to do, is to register your own Amazon AWS account.

Let’s get started

After creating your Amazon AWS Account, you need to register for EC2. The management console allows you to select predefined images (AMIs). There exists a wide range of predefined images. Feel free to select your favourite Linux distribution and follow the installation instructions. After less then 5 minutes, your Server instance is configured and ready to lauch:

A minute later, your Server is up & running. Now you can connect yourself to the server and start configuring it.

Make it even more convenient

A more convenient way however is to use an additional service called Bitnami. Bitnami allows you to preconfigure your server individually through a polished webinterface. Instead of installing the LAMP Stack (Linux, Apache, MySQL, PHP) by hand, Bitnami will do this for you. You just need to decide which kind of Linux Distribution you prefer and what you need on top (e.g. WordPress, Drupal, Joomla, etc). You just configure the server though Bitnami – it will be hosted directly on the AWS infrastructure, within your AWS Account. Here is a look the configuration looks like:

Depending on the size of the instance and hard-disk, bitnami will show you automatically the estimated monthly cost. But again, if you are a new AWS client, a microinstance will be free for one year!

Here is a video which shows you how easy it is to set up your own server:

If you are setting up a remote server on Amazon AWS I suggest to use bitnami. The preconfigured images are very good and they provide a useful Wiki which guides you though the first steps. Bitnami will for example register a DNS record for you automatically so that you can access your server directly by SSH or through your webbrowser.

Costs

Again, Amazon will give you a Micro Instance (2 cores & 613 MB Ram) one year for free. Uptime of your server is billed hourly. By today, an online hour for the instance costs 0,02 USD (free for the first year).  Incoming traffic is free, outgoing traffic costs a little bit (0,1USD / GByte).

I’m using the Iphone App called Cloud Service Manager to conveniently startup, shutdown or monitor my AWS instances.

Final words

It has never been easier to set up your own server. All you need in an Amazon AWS account and your server will be up and running within a few minutes. There is plenty of good wikis and help available, however some basic Linux administration skills won’t harm!

About Tobias (DH1TW)

Self-confessed Starbucks addict. Loves to travel around the globe. Enjoys the technical preparations of Amateur-Radio contests as much as the contests themselves. Engineer by nature. Entrepreneur. For more, follow him @DH1TW

Comments

  1. Hi Tobias,

    That’s a very helpful review of Amazon’s service — it is food for thought.

    I would like to compare EC2 etc with other web services in the market. There are quite a few, like Rackspace, Linode, etc. I think Amazon has a reputation of being somewhat hard to learn/use, if you go beyond the basic applications.

    I haven’t tried any of these services really. I use the more traditional web hosting service 1and1.com. They provide all levels from shared hosting to dedicated systems, and they are now beginning to provide cloud services like Amazon/Rackspace et al.

    The shared hosting that I use provides all the web serving horsepower and bandwidth that I could possibly use for a modest fixed monthly price. You can host an “unlimited” number of sites with “unlimited” disk and bandwidth, with SSH shell access, etc. They have canned versions of Joomla and some other software, but I normally install my own to get the configurations I want.

    So how does the traditional shared hosting stack up against cloud services? The advantages of cloud services seem to be “pay only for what you use”, flexibility, scalability, etc.

    The questions I have relate to user support (how much is available, what is the learning curve? Etc.), the update process (are you responsible for security patches, system updates?). It may come down to who is the intended user for the cloud? Perhaps not the newbie web developer who doesn’t want to be a sysadmin. For someone who is fairly comfortable running a home Linux network (me!), where scalability and variable pricing are not big issues, the main reason to try the cloud is for fun and education. I doubt it will make my life easier than it is with my current hosting situation.

    On the other hand, there might be some interesting ham-type applications where the ability to switch on a “supercomputer” for a short time might help. Maybe you want to dig an exquisitely weak signal out of the noise, ala JT65/WSPR doing EME. But our home computers are already way more powerful than needed for most ham applications, so it’s not obvious that a big Amazon cluster will be needed any time soon.

    Again, thanks for all the info. 73

    Martin
    AA6E

    • Hi Martin,
      you are definitely right – if you only want to host a website, it might be overblown to do that on a dedicated server, especially if you are dealing with low traffic (less that 10.000 visitors / day). There are great hosts around, and some of them even are specialized in content management systems, like http://wpengine.com for WordPress hostings.

      Having SSH access will certainly also allow you a greater deal of possible applications. Unfortunately, none of my providers have offered me SSH shell access until today.

      For “Supercomputers” there might be better kind of resources. Google for example allows access to their CPU power through a python interface. You only pay the CPU power.

      73 Tobias

Speak Your Mind

*