Requirements: Docker can be installed on any Linux with a kernel of at least version 3.10. Docker is supported on the following 64-bit versions of Ubuntu Linux:
Easy Installation
Note: Installing Docker from the default Ubuntu repository will install an old version of Docker.
To install the latest version of Docker using the Docker repository, use curl
to grab and run the installation script provided by Docker:
$ curl -sSL https://get.docker.com/ | sh
Alternatively, wget
can be used to install Docker:
$ wget -qO- https://get.docker.com/ | sh
Docker will now be installed.
Manual Installation
If, however, running the installation script is not an option, the following instructions can be used to manually install the latest version of Docker from the official repository.
$ sudo apt-get update
$ sudo apt-get install apt-transport-https ca-certificates
Add the GPG key:
$ sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 \
--recv-keys 58118E89F3A912897C070ADBF76221572C52609D
Next, open the /etc/apt/sources.list.d/docker.list
file in your favorite editor. If the file doesn’t exist, create it. Remove any existing entries. Then, depending on your version, add the following line:
Ubuntu Precise 12.04 (LTS):
deb https://apt.dockerproject.org/repo ubuntu-precise main
Ubuntu Trusty 14.04 (LTS)
deb https://apt.dockerproject.org/repo ubuntu-trusty main
Ubuntu Wily 15.10
deb https://apt.dockerproject.org/repo ubuntu-wily main
Ubuntu Xenial 16.04 (LTS)
deb https://apt.dockerproject.org/repo ubuntu-xenial main
Save the file and exit, then update your package index, uninstall any installed versions of Docker, and verify apt
is pulling from the correct repo:
$ sudo apt-get update
$ sudo apt-get purge lxc-docker
$ sudo apt-cache policy docker-engine
Depending on your version of Ubuntu, some prerequisites may be required:
Ubuntu Xenial 16.04 (LTS), Ubuntu Wily 15.10, Ubuntu Trusty 14.04 (LTS)
sudo apt-get update && sudo apt-get install linux-image-extra-$(uname -r)
Ubuntu Precise 12.04 (LTS)
This version of Ubuntu requires kernel version 3.13. You may need to install additional packages depending on your environment:
linux-image-generic-lts-trusty
Generic Linux kernel image. This kernel has AUFS built in. This is required to run Docker.
linux-headers-generic-lts-trusty
Allows packages such as ZFS and VirtualBox guest additions which depend on them. If you didn’t install the headers for your existing kernel, then you can skip these headers for the trusty
kernel. If you’re unsure, you should include this package for safety.
xserver-xorg-lts-trusty
libgl1-mesa-glx-lts-trusty
These two packages are optional in non-graphical environments without Unity/Xorg. Required when running Docker on machine with a graphical environment.
To learn more about the reasons for these packages, read the installation instructions for backported kernels, specifically the LTS Enablement Stack — refer to note 5 under each version.
Install the required packages then reboot the host:
$ sudo apt-get install linux-image-generic-lts-trusty
$ sudo reboot
Finally, update the apt
package index and install Docker:
$ sudo apt-get update
$ sudo apt-get install docker-engine
Start the daemon:
$ sudo service docker start
Now verify that docker is running properly by starting up a test image:
$ sudo docker run hello-world
This command should print a welcome message verifying that the installation was successful.