At time of writing (just after 1.9.0 release), this works best on ubuntu trusty:
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
mkdir -p /etc/apt/sources.list.d
echo deb https://apt.dockerproject.org/repo ubuntu-trusty main > /etc/apt/sources.list.d/docker.list
apt-get update;
apt-get install -y -q docker-engine=1.x.x~
In my case, with ansible there are modules for all of these things, so it can fit nicely into a playbook :-).