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
- Launching an instance
- Accessing a running instance
- Setting up an EBS volume for data persistence
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.
Log into the Amazon web console.
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.
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.
Go to the security groups panel.
Here you may want to open any of the following ports:
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.
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).
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