Docker tutorial on Ubuntu installation of Docker

  • 2020-05-30 21:42:50
  • OfStack

The Ubuntu series installs Docker

There are installation guides for various environments on the official website.

Install through the system's own package

Ubuntu 14.04 version of the system has come with the Docker package, can be installed directly.


$ sudo apt-get update
$ sudo apt-get install -y docker.io
$ sudo ln -sf /usr/bin/docker.io /usr/local/bin/docker
$ sudo sed -i '$acomplete -F _docker docker' /etc/bash_completion.d/docker.io

If Docker is installed using the OS's own package, the current installed version is the older version of 0.9.1. To install the newer version, you can do so by using the Docker source.

Install the latest version from the Docker source

To install the latest version of Docker, you first need to install apt-transport-https support, and then install it by adding sources.


$ sudo apt-get install apt-transport-https
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
$ sudo bash -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
$ sudo apt-get update
$ sudo apt-get install lxc-docker

Version before 14.04

If you have a lower version of the Ubuntu system, you need to update the kernel first.


$ sudo apt-get update
$ sudo apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring
$ sudo reboot

Repeat the steps above.

Start the Docker service after installation.


$ sudo service docker start

Thank you for reading, I hope to help you, thank you for your support of this site!


Related articles: