TurnKey Linux: Brisbane Drupal meetup, December 2012

Tags: 

At the December 2012 Brisbane Drupal community meetup, I gave a quick introduction to TurnKey Linux ("TKL") and its potential for use as a local development environment.

This post summarises what was covered and provides reference links.

What it is

Collection of headless Linux installs packaged as plug and play appliances based on Debian (formerly Ubuntu LTS), designed for use in VM and cloud environments, as well as bare metal.

Small.

Approximately 220MB downloads in .iso and various hypervisor- and cloud-friendly image formats.

Fast.

Be up and running with a basic Drupal 7 instance in about 5 minutes.

What you get

Bare-bones server with the sorts of things you need for Drupal (or whichever TKL appliance you choose to install): Apache, MySQL, PHP. These appliances have iptables, openssh and other useful plumbing already set up for near-instant deployment to publicly-facing environments. 

Also, from the point of view of a local development environment a few potentially handy things such as Webmin and even shellinabox if you need to reach your dev environment from somewhere without a useful terminal, such as a Windows machine. 

Where to get TurnKey Linux

TKL is available at http://www.turnkeylinux.org/

TKL v12 on Debian rather than Ubuntu

With version 12, TKL switched from Ubuntu to Debian as the base distro. Three main reasons are given:

  1. More packages receive security patches from Debian itself
  2. More stable due to release philosophy (I got bitten by udev)
  3. Canonical don't currently offer support for TKL as true Ubuntu

After first trying Debian in about 1998 and knowing nothing about Linux at the time, I'm glad to report I'm having more success nowadays. 

How I use it

I prefer the LAMP appliance to the standalone Drupal7 appliance, because the latter seems more suited to single docroots in terms of out-of-the-box Apache configuration.

I use Virtualbox as a hypervisor on my OSX host. Virtualbox has "shared folders" which allow directories on the host to be shared with the guest.  On my work machine I'm using things this way, and it mostly works to give me access to editors such as Sublime Text 2 in the host.

I keep various git-cloned Drupal docroots under my (host) home directory, and the guest's Apache config references the equivalent mounted point.  Every now and again I find the mount doesn't "stick" (on the guest, the mount point shows empty) but a sudo mount -a on the guest usually fixes it.

See an earlier post on this site where I explain the way I've been using sshfs as a different approach to this on my personal laptop, which also works pretty well over a fast host/guest setup.

TKLBAM for backups

The acronym expands to "Turnkey Linux Backup And Migrate". All TKL appliances include the necessary tools to painlessly backup to (and restore from) Amazon S3. You can manage these backups via a web interface at https://hub.turnkeylinux.org/ and it's pretty cheap. AWS bills me less than 10 cents a month to keep a copy of my dev environment stashed. There's a screenshot of the dashboard on the hub site also.

I also regularly backup the entire host machine to local external disks of course, however if my host laptop was damaged or lost and it took me a while to replace the hardware and get up and running again, this gives me another path to quickly become useful on an arbitrary / temporary machine capable of running a VM.