I recently decided to hop on the Amazon Web Services (AWS) Free Tier, and see what it was all about. I use regular AWS services at work quite a bit so I am not a newcomer to the AWS world. However, this was my first foray in to the Free Tier offering. I created this little tutorial based on my own experience as well as some other helpful pages I found about the web.
Just a word before starting, while the AWS platform is quite power and expansive, the learning curve can also be a bit staggering. The interfaces are not what I consider to be intuitive and the documentation is scattered and strewn with propaganda.
0. Before diving in, be sure to read through the “Free” FAQs: http://aws.amazon.com/free/faqs/
1. When you are ready to get going, visit http://aws.amazon.com/free/ and sign up for a free account. You will need to give them a credit card number in order to create an account. The credit card is for when the free period is over, or in case you go over the limits of the “Free” offering, or if you choose to use some of the non-free services.
2. Once your account is create you will now be able to access the AWS Console and sign in.
3. If not already on the EC2 tab, click it. The default seems to be S3
4. In the Navigation, choose a region. I think the default is “US East”. Keep that in mind because each region is different. If you install instances in one region they will not show up in other regions. That can be confusing if you log in and it defaults to a different region. You may think all your instances are gone and start to panic. 😉 (Remember, I learned this from experience.)
5. You can now “Launch an Instance”. There should be a button that says as much made plainly visible. If not, you can click on the “Instances” section on the left.
6. Choose an AMI:
You can choose one of the “Basic Amazon Linux” AMI’s if you would like. They fit the criteria of “Micro”. However, I clicked on the “Community AMIs” tab and typed “ami-ad7e2ee8”. This is an Ubuntu AMI that was designed specifically to be a Micro Instance. I found it from an Ubuntu Cloud blog post.
No matter which AMI you choose, make sure the AMI is 10GB or less and not SUSE or RedHat (there are some licensing issues there that cost money). Safe distributions are: Amazon, Ubuntu, CentOS (as long as they meet the size criteria I mentioned).
Make sure you choose an instance with an EBS root store, if you choose “instance” then you will never be able to reboot the server without losing everything.
7. Instance Details:
There are three screens under the Instance Details step. I only made two changes to the default. First, make sure the instance you choose is “t1.micro”. The is the only instance type that meets Free Tier requirements. Second, is optional, but on the “Key Value” screen, you get to give your instance a “Name”. Call it whatever you want, or skip this part. I would give it a name because if you ever have more than once instance, the information screens can inundate you with information that is not human friendly.
8. Create Key Pair:
If this is a new AWS account and you do not have a Key Pair already, or even if you do and want to create a new one, you can do that here. You will need this in order to SSH into your server. Be very careful not to lose it. If you do, there is no way to recover it, in which case, you will have to create a new key, assign the new key to your instance and restart the instance. It is very easy. Just give it a name and download it.
What you download will be a .pem file. This contains an encryption key, which I will not delve into in this post other than helping you use it to connect to the server.
9. Configure Firewall:
On this step I went with default. You can create your own security group settings here if you want, but you can also do it very easily later. I wanted to get to the end so I just chose the default and moved on. If you do the same, the next screen is review and on that screen you can finally “Launch” your new instance. Click that Launch button and think happy thoughts, but don’t throw a party just yet.
While we are still on this bullet point and while your instance is launching, let us delve further into the firewall. Click on the “Security Groups” navigation link on the left. Then click on the “default group”. Below will be the details. You may need to drag the edge of the details window up so you can see it better.
Now, among other things that you may want to add to these firewall rules, the first thing that we want to add is the ability for you to SSH into your server. Feel free to give everyone access to your server. However, I gave myself access from the two IP’s that I usually access from.
Here is a screen shot showing what it may look like for you:
Take note that the “/32” at the end of the IP address means “this and only this IP address”. (You can read more about CIDR Notation if you feel so inclined.)
Once you save your new entry(s) you are now ready to connect.
10. Connecting to your instance.
If you cannot connect, it is very likely you have something wrong in your Security Group or you are not using your key correctly.
First, you need to find the address of your new server. Click on the Instances section again and then click on your new instance that is in the list now. Below you will see details. What you are looking for is “Public DNS:”. Later, if you want a public static IP address you can get one easily (but not for free) by going to the “Elastic IPs” section. Copy that “Public DNS:” address and you are ready to do some server shelling.
Here is what the command could look like for you:
ssh firstname.lastname@example.org -i /path/to/aws_key.pem
Let us now analyze this command:
– “ssh” is, well, if you do not know what that is then may need a different tutorial. If you truly do not know what that is, let me know and I can provide some further direction.
– “ubuntu” is the default user that comes with the instance. Some instances will use “root” as the default user. Each type of instance will be a bit different. For the AMI that I used, the user is “ubuntu”.
– “ec2-123-123-123-123.us-west-1.compute.amazonaws.com” is the Public DNS address that you copied from the instance details.
– “-i” is the ssh switch that tells ssh to use a different file for connection keys
– “/path/to/.ssh/aws_key.pem” is the actual path and key file that you downloaded in step 8 when you created a key pair.
If you did everything correctly, once you issue that command you will now be connected to your new server that is living and running in the AWS cloud as a Micro Instance on the Free Tier. Congratulations!
Now, how you setup your server and what you do with it is completely up to you. There are a plentiful number of tutorials out there that explain those options.
Now that your AWS Free Tier Micro Instance is setup, you will want to monitor your account usage and billing to make sure you are staying within the “Free” realm. To do this from in the console, click on the “Account” link that should be at the top, then you can look at the “Account Activity” and “Usage Reports”.
That is is! Have fun! Let me know how it goes for you.
If you have questions, feel free to ask them below.