Installing Docker on Ubuntu 16.04 LTS - “Xenial Xerus”

  1. Check the Kernel Version

    ubuntu@ubuntu:~$ uname -r
    

    Expected Response

    4.4.0-42-generic
    
  2. Update package information, ensure that APT works with the https method, and that CA certificates are installed.

$ sudo apt-get update
  1. Add the keys from the keyserver
    $ sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 \
--recv-keys 58118E89F3A912897C070ADBF76221572C52609D

Expected Output

Executing: /tmp/tmp.VEHRG1bkmN/gpg.1.sh --keyserver
   hkp://p80.pool.sks-keyservers.net:80
    --recv-keys
   58118E89F3A912897C070ADBF76221572C52609D
   gpg: requesting key 2C52609D from hkp server p80.pool.sks-keyservers.net
   gpg: key 2C52609D: public key "Docker Release Tool (releasedocker)
     <docker@docker.com>" imported
   gpg: Total number processed: 1
   gpg:               imported: 1  (RSA: 1)
  1. Add end point for ubuntu-xenial to /etc/apt/sources.list.d
$ sudo vi /etc/apt/sources.list.d/docker.list

For Ubuntu xenial , add following line to the file

deb https://apt.dockerproject.org/repo ubuntu-xenial main
  1. For aufs use linux-image-extra
$ sudo apt-get install linux-image-extra-$(uname -r)
  1. Install docker binary
$ sudo apt-get install docker-engine
$ sudo service docker start

Check the docker version

$ docker --version
Docker version 1.12.2, build bb80604
  1. Optional : Add current user to docker group to avoid using sudo
$ sudo usermod -aG docker ubuntu

Give Permissions to current user to execute docker binary

$ sudo chmod 755 /usr/bin/docker