back to main page

by Felix Becker | Nov 03, 2014

Install Docker in 3 easy steps

What is this Docker thing:

Before you start with the installation and you haven't heard about Docker yet, I recommend to check out my post: What is Docker and why you should care.

After you are set up with the basics behind docker we will install Docker in this post:

How to install Docker in 3 easy steps.

  1. Prepare and check your system
  2. Install the docker bits
  3. Start working with Docker

So let’s get started!

Official Docker logo

1. Prepare the system

Since Docker was just announced to run nativly on Windows it does not yet by the time of writing this blog post. That's why this tutorial will go through the installation on Ubuntu. To get started you would need to have a Unix environment handy. I happen to have a Virtualbox with Ubuntu.

First you want to check which Ubuntu Version is actively running with lsb_release –a
Results can look like this screen:
Image check version Ubuntu

Based on our gained information head over to the Docker website and check out the docs how to install Docker on Ubuntu 14.04 (Trusty).

If you are running the same version as me just keep going.

Since the package manager could be outdated I certainly want to get the latest version of Docker. For that I need to configure apt-get so that it can deal with https as a prerequisite.

To check for https support we simply need to list all files in following folder and look for https, like seen below.

image check if apt-get supports https

Looks like we are all set.

Then we want to add Docker to the our local keychain

$ sudo apt-key adv --keyserver hkp:// --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9

Image result of adding docker repository to the local keychain

Next step is to add Docker to the package list

$ sudo sh -c "echo deb docker main\ /etc/apt/sources.list.d/docker.list `

After that you just need to update the package list

$ sudo apt-get update

2. Install the bits

And install lxc-docker
$ sudo apt-get install lxc-docker

3. Start working with Docker

To verify the installation execute following command

$ sudo docker run –it ubuntu /bin/bash

docker downloads ubuntu images

Docker now downloads the latest Ubuntu image and executes /bin/bash on it

resulting docker bash within the container

Voila done! We could execute the our know command from the beginning to find out which version we are running within the Docker container…

We basically installed the Docker environment downloaded an Ubuntu container and hocked it up so that we can access the bash. We discovered What is Docker and why you should care.

If you are on Mac, you should also consider taking advantage of vagrant: check out the docs here

With this you should be all set to try it out yourself. Now go and build something!

So long...

back to main page