Old tutorial: launching TurnKey AMIs with the Amazon Web Console
Warning: this is an old tutorial from before we created TurnKey Hub, a web service which makes it much easier to launch and manage TurnKey Linux appliances in the Amazon EC2 cloud. TurnKey Hub automatically takes care of the many potentially confusing and frustrating details described below.
If you're not using TurnKey Hub, you'll need a free subscription to TurnKey's AMIs (Amazon Machine Images) to continue...
Table of contents
- Background
- Launching an instance
- Accessing a running instance
- Setting up an EBS volume for data persistence
Background
EC2 has many powerful features, which can make it confusing for new users.
This tutorial does not assume previous experience with EC2. We'll show how to launch the TurnKey LAMP appliance on EC2 using Amazon's management console but the principles are the same even if you use a different interface such as the ElasticFox FireFox extension or Amazon's command line API.
Launching an instance
Log into the Amazon web console.

Launch instance wizard
Select the region where you want to launch an instance (us-east-1, us-west-1, eu-west-1).
Click on the Lauch Instances button which launches the Launch Instance Wizard.
Select the community AMIs tab. Entering "turnkeylinux" into the text box will give you a list of available TurnKey Linux appliances.

To select the AMI you would like to launch, click select or enter its codename (e.g., turnkey-lamp).
Note that old AMIs have the turnkey-ami- prefix while new AMIs have the turnkeylinux- prefix:

If you haven't setup an SSH keypair, Amazon will prompt you to do so. Later, you can use it to log into your instance.

Firewall security groups
If you haven't set up a firewall security group the wizard will create a new group that only allows port 22.
Note that to access the full range of services available on your appliance instance you'll later have to add additional ports to the security group.

Finalize and launch

Opening additional ports
Go to the security groups panel.

Here you may want to open any of the following ports:
| 22 | SSH/SFTP |
| 80 | HTTP |
| 443 | SSL |
| 12320 | Web shell |
| 12321 | Webmin |
| 12322 | Database front-end |
Accessing a running instance
Go to instances panel. Clicking on the instance shows its public IP address

"Instance actions -> Connect" shows how you can use the keypair to login with SSH.

You can also log in with the initial root password, which is available in the output of the system log (Instance Actions -> System Log). It's generated randomly so you may want to change it to something more rememrable if you're going to be using webmin or the Ajax web shell.
Note: Where applicable, the MySQL/root and PostgreSQL/postgres are also randomly set on first boot, and are identical to the root password displayed in the system log.

Setting up an EBS volume for data persistence
Go to "Volumes" panel

Create a volume. Make sure you create it in exactly the same availability zone as your instance otherwise you won't be able to attach it to the instance.

Attach it to your instance.

The new volume is "hotplugged" to your instance on the fly (it shows up as device /dev/sdf).
Mounting an EBS device
You don't need to do anything if the device has already been formatted (I.e., contains a filesystem). It will be mounted automatically by EBSmount when attached.
But new EBS devices need to be formatted first:
ebsmount-manual --format=ext3 /dev/sdf
Comments
AWS instantiation fails following above procedure
Hi.
I purchased your AMI and opened an AWS account today. On the last step of the AWS Request Instances Wizard, I get the error message "Subscription to ProductCode C1BC2EEF required". I cannot find that module in AWS online docs. Is that your AMI?
What should I do to complete the instantiation process?
follow-up
OK, C1BC2EEF is the product code for Turnkey's AMI. So the question is: where do I activate my subscription to your product?
Currently every AMI has a different product code
I subscribed to "TurnKey
I subscribed to "TurnKey Drupal6 AMI for Amazon EC2". When I click the link to the app on my Amazon purchase, I land on this page, which does not ask for a product key (even says a key is not needed - on top of this page!).
product code
My Amazon purchase states "TurnKey Drupal6 AMI for Amazon EC2", which is what I'm looking for, but maybe not the AMI stated in the tutorial above?
OK, working now
OK, my problem was that I needed to select the Drupal AMI, not the LAMP AMI which was given as example. duh.
Thanks for the help!
Subscription to ProductCode A68DA028 required
I subscribed to the turnkey-joomla product and when I follow the instructions I cannot continue b/c of the subject error above. I subscribed to the Joomla product and I am choosing the Joomla product in the AMI choices.
Does it take a certain time period (24 hours, etc) before the Product is registered? I have confirmation of payment in AWS and they have given me a code, but I see no place to enter it in the instructions.
Thank you!
No it should work immediately
I apologize for the inconvenience on your end. The workflow is still a bit complex, and we are currently working on developing a web application that will make it easier to get up and running.
Error in execution of ebsmount service
At the end of first time formatting, mid-way through execution of the "/etc/init.d/ebsmount start" command, I get some errors in mysql-common:
executing: drupal6
executing: mysql-common
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Probably not a problem + lets move this to the forum
Also, this isn't really the best place to discuss support issues. That's what the support forum is for.
Recommended use of PostgreSQL
Hi guys
Thanks for the great walkthrough up above. We're setting up a Postgres database and will probably use your solution
If it isn't easy to get the EC2 instances to automatically attach to the EBS volumes, what do you recommend as far as operating a PostgreSQL database? Should we shut it down when we know we aren't going to use it, then go through the re-attach when we want to use it again?
Also is it possible to use the 150GB that comes with an intance as database storage? Or is that unreliable/likely to disappear?
Also, we're having some debate about which OS to use. One teammate likes Fedora, another wants OpenSUSE, etcetc. Any words of wisdom on how you decided (incidentally, what do your images use?) and how well others work on EC2?
Thanks!
Ubuntu 8.04 LTS
I dont know about EC2, but the TKL images are based on Ubuntu 8.04 LTS.
http://UnmeteredVPS.net/tkl
Try our TurnKey Linux appliance hosting FREE!
EC2 is pretty reliable in practice but backup anyway
It is possible to use the instance storage for your database but please make sure to setup regular backups. Preferably automated. You should do that with any server, regardless of what platform it's running on. An EC2 server is no exception. Even if you use EBS!
BTW we're actually working right now on making all of that simpler. We want it to be easy for users to migrate instances running on local computers into the cloud, to setup regular backups, etc. If you register for an account on the site we'll let you know when we open that up for a public beta.
And Neil is right. All TurnKey images are currently based on the latest Ubuntu LTS (Long Term Support) version 8.04.3. Debian support is planned. Support for other distributions (e.g., CentOS) isn't currently planned but we're not opposed to it in principle, it's just a matter of resources.
CentOS?
What would be involved in making CentOS based ports of the appliances? I use CentOS for all my servers and am very familiar with it so I could lead that effort.
http://UnmeteredVPS.net/tkl
Try our TurnKey Linux appliance hosting FREE!
Thanks for volunteering but it's a bit premature
In terms of the effort involved it's similar to migrating 40 different servers from Ubuntu Server to CentOS. Not a trivial effort, and currently a bit premature since there are a few prerequisites which we need to work on first. Volunteering to help does make it more likely we'll pursue that though.
In the meantime, let's move this and other non-EC2 related discussions to the forum.
AMI images ot showing up on Amazon AWS ...
I cant seem to find your images on Amazon AWS. I put 'turnkey' into the filter box under 'All Images' within the 'Community AMIs' tab and nothing shows up. I even tried to enter a few ami ids (ami-xxxxxxx ) I see on your screenshots but nothing is showing up.... Are you still current on Amazon?
AMI's are region specific
I hope this helps.
AMIs - Your hunch is correct, sir.
Yep. I did connect to the US-WEST-1. I guess it doesn't really matter what region I use for now. Your response and work are much appreciated.
EBS boot image
Hi,
Is it possible you convert the instances to EBS boot instances (or offer them as an alternative)? I have done one convert myself of my own custom instance and; although not very easy; if you dive into it; you should have it done within a few hours. EBS boot instance are far easier to backup (click of a button). If you need help / advice let me know; there are a few tricky things but if you get a good manual things shouldn't be too complicated.
We're working on a similar problem, different approach
EBS Boot Image
This might help to convert the existing AMI to EBS boot AMI
http://www.capsunlock.net/2009/12/create-ebs-boot-ami.html
Run same MediaWiki site from two EC2 locations
I just created an MediaWiki website at Amazon EC2 using this Turnkey's MediaWiki package and for performance and resilience I would like to run the same MediaWiki content from two different EC2 locations (US and EU).
(note: I've also just asked the same question at http://stackoverflow.com/questions/2265753/running-1-mediawiki-site-from-two-amazon-ec2-servers)
Updated documentation
I just updated the documentation to be inline with our latest release.
Notable changes:
Subscription to ProductCode C1BC2EEF required.
I have successfully purchase all AMI's. When I try to launch an instance, at the final step, I receive the following message:
Subscription to ProductCode C1BC2EEF required.
C1BC2EEF is the old LAMP AMI product code
You are attempting to launch the old LAMP appliance. All the newly released AMI's (2009.10-2) have the product code BA39B70F.
You can find the complete AMI's listing here, or if you are searching with the AWS console, take note of the new buckets naming convention: