- Update apt-get.
$ sudo apt-get update
- Get PGP key.
$ sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
Ubuntu | version | Repository |
---|---|---|
Precise | 12.04 (LTS) | deb https://apt.dockerproject.org/repo ubuntu-precise main |
Trusty | 14.04 (LTS) | deb https://apt.dockerproject.org/repo ubuntu-trusty main |
Wily | 15.10 | deb https://apt.dockerproject.org/repo ubuntu-wily main |
Xenial | 16.04 (LTS) | deb https://apt.dockerproject.org/repo ubuntu-xenial main |
- Add repo to docker.list.
$ echo "<REPO>" | sudo tee /etc/apt/sources.list.d/docker.list
- After create docker.list, update apt-get
$ sudo apt-get update
- Check the instalation.
$ sudo apt-cache policy docker-engine
-
Ubuntu Xenial 16.04 (LTS), Wily 15.10, Trusty 14.04 (LTS)
..-
For Ubuntu Trusty, Wily, and Xenial, install the linux-image-extra-* kernel packages.
-
To install the linux-image-extra-* packages:.
-
Open a terminal on your Ubuntu host.
-
- Update your package manager.
$ sudo apt-get update
- Install the recommended packages.
$ sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual
-
Ubuntu Precise 12.04 (LTS)
- For Ubuntu Precise, Docker requires the 3.13 kernel version. If your kernel version is older than 3.13, you must upgrade it.
- Refer to this table to see which packages are required for your environment:
- Update your package manager.
$ sudo apt-get update
- Install both the required and optional packages.
$ sudo apt-get install linux-image-generic-lts-trusty
- Reboot your host to use the updated kernel.
$ sudo reboot
Make sure you have satisfied all the prerequisites, then follow these steps.
Note: For production systems, it is recommended that you install a specific version so that you do not accidentally update Docker. You should plan upgrades for production systems carefully. Log into your Ubuntu installation as a user with sudo privileges.
- Update your APT package index.
$ sudo apt-get update
- Install Docker.
$ sudo apt-get install docker-engine
- Start the docker daemon.
$ sudo service docker start
Command line
sudo usermod -aG docker $(whoami)
or
sudo usermod -aG docker username
$ sudo docker run hello-world
Output...
Hello from Docker.
This message shows that your installation appears to be working correctly.
...