Quick start to using Amazon EC2 as a free VPS!

UPDATE: Warning! An EC2 Micro Instance is dead-slow. Consider this carefully before investing too much time with EC2. Sometimes cheap VPS is better value than free.

Most people know Amazon for the online store or the Kindle, but in tech circles they're also well known for the Amazon Web Services offerings. AWS is basically a set of services that enable users to easily build highly scalable web applications with a pay-per-use pricing model.

The products page may seem a little confusing at first, with service names like Elastic Compute Cloud (EC2), Elastic Load Balancing, Simple Storage Service, Relational Database Service, Elastic IPs, etc. A lot of these can be used independently to stitch together a custom solution for whatever you're trying to achieve. In this guide, I'll talk about using EC2 with EBS and an Elastic IP to build a free Virtual Private Server that you can use for whatever you want (host a website, host a proxy, dev/test server, etc.).

To do this, you need to sign up for a new AWS account to take advantage of the Free Tier offer. With this, you get free access to a micro EC2 instance for a year, plus free 10GB of EBS storage, and the Elastic IP is free while attached to an instance.

EC2 is basically just a collection of virtual images running in the cloud. You can create one or more Linux or Windows based images, install whatever software you want on them, and run them whenever needed. You pay by the hour of up-time, so if you want to run a web-site, you basically need to run it 24/7, so you'll be paying up to 744 hours per month. The cost per hour depends on the hardware allocated to each instance. A micro instance gives you about 650MB of memory and costs $0.02 an hour, so around $15 a month. But as a new AWS customer, you get 750 free hours a month, i.e. you can run a micro ec2 instance continuously for free!

To create an instance is easy. Just login to the AWS console and click the EC2 tab at the top. Then click on instances on the left, and click to create a new instance. Select micro, and follow the wizard to get started. You'll be creating a private/public key pair that you'll use to SSH into your box, and you also need to select the open ports (ssh, http, https, etc). Once done, you'll have a running instance in a few seconds.

To connect, select the instance and click the connect button. This will just show you a dialog with the address of the machine, something like ec2-50-10-200-100.compute-1.amazonaws.com. If using Putty as your SSH client, you first need to use Puttygen to convert the private key file into a compatible format, then attach that to the Putty session and login as user ec2-user@your-instance address. You can now install whatever software you want using yum and configure whatever services you need (mysql, apache, squid, etc).

Once you're done, go back to the AWS web console. Go to instances, click on your running instance, click Instance Actions, and click create AMI EBS. This will write out your instance to Elastic Block Storage, of which you also get 10GB of. EBS is the persistence storage mechanism, basically a virtual hard-drive. Once the AMI is created (may take 10 minutes or so), you can select it, and choose to boot a new instance from it. So what you're doing is basically attaching a virtual micro instance to your virtual persisted hard-disk.

Every time you create a new micro instance though, it will be assigned a new address, which makes it a bit hard to keep track of all your ssh/sftp connection configs, and also to map a domain to. This is where an Elastic IP comes in. An Elastic IP is actually a static IP that you own as part of your AWS account. You can then attach these static IPs to any running instance. Attached Elastic IPs are free while attached, and you get 100 free remapping per month.

The final step is to sign-up for a new domain with say GoDaddy, then just point the A record to your Elastic IP. With this setup you have a free virtual linux machine running out in the cloud, with 600MB+ RAM and decent processing. This can be configured to host a small-to-medium website with whatever technology stack you want. You have full sudo root access to the box!

NOTE: Take a good look at the pricing page though. Everything should be free to new customers if you follow the guide-lines, but there are costs involved per I/O operations, per in/out transfers, per IP mappings, per EBS storage, etc. These are fairly low, but they're there to prevent customers taking advantage of the services to do massive data crunching or massive network re-routing. Be aware of these, and keep an eye on your account billing page. A small to medium website should not cost anything, but if you go nuts...be warned.


  1. I don't typically agree with the information that are shown on web sites but in this case I agree.
    cheap windows vps

  2. If you need a free vps without cost. you guys can get a working list from http://free-vps-cloud.blogspot.com/p/list-working.html . update daily.


Post a Comment

Popular posts from this blog

Wkhtmltopdf font and sizing issues

Import Google Contacts to Nokia PC Suite

Can't delete last blank page from Word