I have been with dreamhost for 1400 days before I opted to move everything to AWS. I did not had any particular problem with dreamhost. They are good and their support is even better but I wanted to explore AWS, move away from my comfort zone of hosted services, get my hands dirty and learn things in the process. I will be documenting the solutions of the common problems I face and their solutions.
Starting with the basics – AWS pricing structure can be a pain to understand for normal users as they charge for storage, computation, bandwidth etc. They provide a free tier for first year for new customers – which is a plus. For normal usage, one will not even pay anything for first year.
The first concept to understand is: EC2 and EBS. EC2 is elastic compute unit – which has certain CPU power and RAM associated with it. Details of different type of instances can be seen on the AWS page. To store the data, these EC2 units can either use local instance storage (like an internal hard disk) or Elastic Block storage (like an external one).
The free tier allows only micro instance (which is still better than normal VPS) with 613 MB of memory with 32-bit or 64-bit platform and can be used with EBS storage only. (Details of EBS on amazon page). Important point to note is: EBS is independent of the life of EC2. So, it can be attached with another EC2 instance later – when you need more memory or computation power, you can shift to better EC2 instance and use the same EBS volume.
Next word that one should know is ‘availability zone’. AWS gives us an option to select a geographic region for each EC2 instance and EBS volume. Although we can choose any region but one should always choose the nearest location from users. In a large application scenario – one will always keep multiple instances across regions and load balance accordingly. Now, prices of ec2 varies from region to region and amazon charges for transfers between regions as well. Also, EC2 and EBS volumes needs to be in same zone or they won’t work together.
Next term is AMI (Amazon Machine Images). Quoting from amazon’s page:
An Amazon Machine Image (AMI) is a special type of pre-configured operating system and virtual application software which is used to create a virtual machine within the Amazon Elastic Compute Cloud (EC2). It serves as the basic unit of deployment for services delivered using EC2.
Now that we understand all the basic terms – we are ready to start and deploy a basic test website. So, here are the steps:
- Create an account with aws. You will need a valid phone number and a credit card. Even though they won’t charge you if your usage are within free tier limit – the credit card is required.
- Login to aws management console. One can manage the account using ec2-instance-api as well but using web console is the easiest.
- Select the EC2 tab – if not already selected.
- Decide on a region. The options are US East, US West, EU West Ireland, Asia Pacific Singapore, Asia Pacific Tokyo. Region can be selected from top left of the sidebar.
- Click on Instance > Launch Instance.
- Next step is to decide on an AMI. We need to get an AMI for the kind of operating system we need. You can search for various EMI on the screen. I prefer 64 bit ubuntu 11.04 release. (AMI ID: ami-60582132 – its free tier eligible.) While selecting an AMI, note the root device volume. Free tier provides 10GB of free storage. So, if your root device volume is more than 10GB – you will have to pay for additional space.

- As the next step you will have to decide on a EC2 instance type. Micro, small, large or extra large. Since free tier provides with Micro instance option – let’s assume that we decide on a micro instance type. Note that we can always change the instance type, when we want to scale. Let others options be default.
- Next very crucial step is to create a key pair. Type in a name for your keypair and download it. Please note that without this keypair you will not be able to access your instance and anyone who has access of this .pem file will have all access to your machine. So, keep it safe. The same key can be used in future for other instances as well.
- Next step is to configure the firewall. By default, no port on your machine will be open. So, one should add port 22 for SSH and port 80 for http. (unless not required).
- Once you review and launch your instance – your machine will be up and running in few minutes. You can see your instance by clicking on “Instance” on sidebar. Please note that this will also create a Volume, which you can see by clicking “Volumes” on sidebar under “Elastic Block Store” heading.
Now that we have our machine ready, we will login and setup our website next time.









August 1st, 2011 at 4:12 pm
[...] Experiments with AWS – 2 : Connect to EC2 instance August 1, 2011.My Experiments with AWS – 1 : Basics of Amazon Web Services July 31, 2011.Basic regex reference July 21, 2011.To be a good web developer July 20, 2011.How to [...]
August 1st, 2011 at 9:54 pm
[...] DNS for ec2 August 1, 2011.My Experiments with AWS – 2 : Connect to EC2 instance August 1, 2011.My Experiments with AWS – 1 : Basics of Amazon Web Services July 31, 2011.Basic regex reference July 21, 2011.To be a good web developer July 20, [...]