2014-05-17 20:28:39 +00:00
|
|
|
page_title: Installation on Debian
|
2014-05-27 17:08:19 +00:00
|
|
|
page_description: Instructions for installing Docker on Debian.
|
2014-05-17 20:28:39 +00:00
|
|
|
page_keywords: Docker, Docker documentation, installation, debian
|
|
|
|
|
|
|
|
# Debian
|
|
|
|
|
|
|
|
Docker is supported on the following versions of Debian:
|
|
|
|
|
2014-12-13 00:45:22 +00:00
|
|
|
- [*Debian 8.0 Jessie (64-bit)*](#debian-jessie-80-64-bit)
|
2014-12-18 10:24:59 +00:00
|
|
|
- [*Debian 7.7 Wheezy (64-bit)*](#debian-wheezystable-7x-64-bit)
|
2014-05-17 20:28:39 +00:00
|
|
|
|
|
|
|
## Debian Jessie 8.0 (64-bit)
|
|
|
|
|
|
|
|
Debian 8 comes with a 3.14.0 Linux kernel, and a `docker.io` package which
|
|
|
|
installs all its prerequisites from Debian's repository.
|
|
|
|
|
|
|
|
> **Note**:
|
|
|
|
> Debian contains a much older KDE3/GNOME2 package called ``docker``, so the
|
|
|
|
> package and the executable are called ``docker.io``.
|
|
|
|
|
|
|
|
### Installation
|
|
|
|
|
|
|
|
To install the latest Debian package (may not be the latest Docker release):
|
|
|
|
|
|
|
|
$ sudo apt-get update
|
|
|
|
$ sudo apt-get install docker.io
|
|
|
|
|
|
|
|
To verify that everything has worked as expected:
|
|
|
|
|
|
|
|
$ sudo docker run -i -t ubuntu /bin/bash
|
|
|
|
|
|
|
|
Which should download the `ubuntu` image, and then start `bash` in a container.
|
|
|
|
|
2015-03-11 16:56:04 +00:00
|
|
|
> **Note**:
|
2014-05-17 20:28:39 +00:00
|
|
|
> If you want to enable memory and swap accounting see
|
|
|
|
> [this](/installation/ubuntulinux/#memory-and-swap-accounting).
|
|
|
|
|
2014-08-24 10:18:56 +00:00
|
|
|
## Debian Wheezy/Stable 7.x (64-bit)
|
|
|
|
|
2014-08-31 23:55:53 +00:00
|
|
|
Docker requires Kernel 3.8+, while Wheezy ships with Kernel 3.2 (for more details
|
|
|
|
on why 3.8 is required, see discussion on
|
2015-04-15 18:23:28 +00:00
|
|
|
[bug #407](https://github.com/docker/docker/issues/407)).
|
2014-08-24 10:18:56 +00:00
|
|
|
|
2014-12-18 10:22:08 +00:00
|
|
|
Fortunately, wheezy-backports currently has [Kernel 3.16
|
2014-08-31 23:55:53 +00:00
|
|
|
](https://packages.debian.org/search?suite=wheezy-backports§ion=all&arch=any&searchon=names&keywords=linux-image-amd64),
|
|
|
|
which is officially supported by Docker.
|
2014-08-24 10:18:56 +00:00
|
|
|
|
|
|
|
### Installation
|
|
|
|
|
2014-12-18 10:22:08 +00:00
|
|
|
1. Install Kernel from wheezy-backports
|
2015-03-11 16:56:04 +00:00
|
|
|
|
2014-08-31 23:55:53 +00:00
|
|
|
Add the following line to your `/etc/apt/sources.list`
|
2014-08-24 10:18:56 +00:00
|
|
|
|
2014-08-31 23:55:53 +00:00
|
|
|
`deb http://http.debian.net/debian wheezy-backports main`
|
2014-08-24 10:18:56 +00:00
|
|
|
|
2014-08-31 23:55:53 +00:00
|
|
|
then install the `linux-image-amd64` package (note the use of
|
|
|
|
`-t wheezy-backports`)
|
2015-03-11 16:56:04 +00:00
|
|
|
|
2014-08-31 23:55:53 +00:00
|
|
|
$ sudo apt-get update
|
|
|
|
$ sudo apt-get install -t wheezy-backports linux-image-amd64
|
2014-08-24 10:18:56 +00:00
|
|
|
|
2015-03-11 16:56:04 +00:00
|
|
|
2. Restart your system. This is necessary for Debian to use your new kernel.
|
|
|
|
|
|
|
|
3. Install Docker using the get.docker.com script:
|
2015-04-07 05:01:34 +00:00
|
|
|
|
2014-09-23 23:18:09 +00:00
|
|
|
`curl -sSL https://get.docker.com/ | sh`
|
2014-08-24 10:18:56 +00:00
|
|
|
|
2015-04-07 05:01:34 +00:00
|
|
|
>**Note**: If your company is behind a filtering proxy, you may find that the
|
|
|
|
>`apt-key`
|
|
|
|
>command fails for the Docker repo during installation. To work around this,
|
|
|
|
>add the key directly using the following:
|
|
|
|
>
|
|
|
|
> $ wget -qO- https://get.docker.com/gpg | sudo apt-key add -
|
|
|
|
|
2014-08-24 10:18:56 +00:00
|
|
|
## Giving non-root access
|
2014-05-17 20:28:39 +00:00
|
|
|
|
2014-05-21 21:05:19 +00:00
|
|
|
The `docker` daemon always runs as the `root` user and the `docker`
|
|
|
|
daemon binds to a Unix socket instead of a TCP port. By default that
|
|
|
|
Unix socket is owned by the user `root`, and so, by default, you can
|
|
|
|
access it with `sudo`.
|
|
|
|
|
|
|
|
If you (or your Docker installer) create a Unix group called `docker`
|
|
|
|
and add users to it, then the `docker` daemon will make the ownership of
|
|
|
|
the Unix socket read/writable by the `docker` group when the daemon
|
|
|
|
starts. The `docker` daemon must always run as the root user, but if you
|
|
|
|
run the `docker` client as a user in the `docker` group then you don't
|
|
|
|
need to add `sudo` to all the client commands. From Docker 0.9.0 you can
|
|
|
|
use the `-G` flag to specify an alternative group.
|
2014-05-17 20:28:39 +00:00
|
|
|
|
2015-03-11 16:56:04 +00:00
|
|
|
> **Warning**:
|
2014-05-17 20:28:39 +00:00
|
|
|
> The `docker` group (or the group specified with the `-G` flag) is
|
|
|
|
> `root`-equivalent; see [*Docker Daemon Attack Surface*](
|
2014-12-13 00:45:22 +00:00
|
|
|
> /articles/security/#docker-daemon-attack-surface) details.
|
2014-05-17 20:28:39 +00:00
|
|
|
|
|
|
|
**Example:**
|
|
|
|
|
|
|
|
# Add the docker group if it doesn't already exist.
|
|
|
|
$ sudo groupadd docker
|
|
|
|
|
|
|
|
# Add the connected user "${USER}" to the docker group.
|
|
|
|
# Change the user name to match your preferred user.
|
|
|
|
# You may have to logout and log back in again for
|
|
|
|
# this to take effect.
|
|
|
|
$ sudo gpasswd -a ${USER} docker
|
|
|
|
|
|
|
|
# Restart the Docker daemon.
|
|
|
|
$ sudo service docker restart
|
|
|
|
|
2014-08-24 10:18:56 +00:00
|
|
|
|
2014-05-21 21:05:19 +00:00
|
|
|
## What next?
|
|
|
|
|
|
|
|
Continue with the [User Guide](/userguide/).
|