github.com/jogo/docker@v1.7.0-rc1/docs/sources/installation/debian.md (about)

     1  page_title: Installation on Debian
     2  page_description: Instructions for installing Docker on Debian.
     3  page_keywords: Docker, Docker documentation, installation, debian
     4  
     5  # Debian
     6  
     7  Docker is supported on the following versions of Debian:
     8  
     9   - [*Debian 8.0 Jessie (64-bit)*](#debian-jessie-80-64-bit)
    10   - [*Debian 7.7 Wheezy (64-bit)*](#debian-wheezystable-7x-64-bit)
    11  
    12  ## Debian Jessie 8.0 (64-bit)
    13  
    14  Debian 8 comes with a 3.16.0 Linux kernel, the `docker.io` package can be found in the `jessie-backports` repository. Reasoning behind this can be found <a href="https://lists.debian.org/debian-release/2015/03/msg00685.html" target="_blank">here</a>. Instructions how to enable the backports repository can be found <a href="http://backports.debian.org/Instructions/" target="_blank">here</a>.
    15  
    16  > **Note**:
    17  > Debian contains a much older KDE3/GNOME2 package called ``docker``, so the
    18  > package and the executable are called ``docker.io``.
    19  
    20  ### Installation
    21  
    22  Make sure you enabled the `jessie-backports` repository, as stated above.
    23  
    24  To install the latest Debian package (may not be the latest Docker release):
    25  
    26      $ sudo apt-get update
    27      $ sudo apt-get install docker.io
    28  
    29  To verify that everything has worked as expected:
    30  
    31      $ sudo docker run --rm hello-world
    32  
    33  This command downloads and runs the `hello-world` image in a container. When the
    34  container runs, it prints an informational message. Then, it exits.
    35  
    36  > **Note**:
    37  > If you want to enable memory and swap accounting see
    38  > [this](/installation/ubuntulinux/#memory-and-swap-accounting).
    39  
    40  ### Uninstallation
    41  
    42  To uninstall the Docker package:
    43  
    44      $ sudo apt-get purge docker-io
    45  
    46  To uninstall the Docker package and dependencies that are no longer needed:
    47  
    48      $ sudo apt-get autoremove --purge docker-io
    49  
    50  The above commands will not remove images, containers, volumes, or user created
    51  configuration files on your host. If you wish to delete all images, containers,
    52  and volumes run the following command:
    53  
    54      $ rm -rf /var/lib/docker
    55  
    56  You must delete the user created configuration files manually.
    57  
    58  ## Debian Wheezy/Stable 7.x (64-bit)
    59  
    60  Docker requires Kernel 3.8+, while Wheezy ships with Kernel 3.2 (for more details
    61  on why 3.8 is required, see discussion on
    62  [bug #407](https://github.com/docker/docker/issues/407)).
    63  
    64  Fortunately, wheezy-backports currently has [Kernel 3.16
    65  ](https://packages.debian.org/search?suite=wheezy-backports&section=all&arch=any&searchon=names&keywords=linux-image-amd64),
    66  which is officially supported by Docker.
    67  
    68  ### Installation
    69  
    70  1. Install Kernel from wheezy-backports
    71  
    72      Add the following line to your `/etc/apt/sources.list`
    73  
    74      `deb http://http.debian.net/debian wheezy-backports main`
    75  
    76      then install the `linux-image-amd64` package (note the use of
    77      `-t wheezy-backports`)
    78  
    79          $ sudo apt-get update
    80          $ sudo apt-get install -t wheezy-backports linux-image-amd64
    81  
    82  2. Restart your system. This is necessary for Debian to use your new kernel.
    83  
    84  3. Install Docker using the get.docker.com script:
    85  
    86      `curl -sSL https://get.docker.com/ | sh`
    87  
    88  >**Note**: If your company is behind a filtering proxy, you may find that the
    89  >`apt-key`
    90  >command fails for the Docker repo during installation. To work around this,
    91  >add the key directly using the following:
    92  >
    93  >       $ wget -qO- https://get.docker.com/gpg | sudo apt-key add -
    94  
    95  ### Uninstallation
    96  
    97  To uninstall the Docker package:
    98  
    99      $ sudo apt-get purge lxc-docker
   100  
   101  To uninstall the Docker package and dependencies that are no longer needed:
   102  
   103      $ sudo apt-get autoremove --purge lxc-docker
   104  
   105  The above commands will not remove images, containers, volumes, or user created
   106  configuration files on your host. If you wish to delete all images, containers,
   107  and volumes run the following command:
   108  
   109      $ rm -rf /var/lib/docker
   110  
   111  You must delete the user created configuration files manually.
   112  
   113  ## Giving non-root access
   114  
   115  The `docker` daemon always runs as the `root` user and the `docker`
   116  daemon binds to a Unix socket instead of a TCP port. By default that
   117  Unix socket is owned by the user `root`, and so, by default, you can
   118  access it with `sudo`.
   119  
   120  If you (or your Docker installer) create a Unix group called `docker`
   121  and add users to it, then the `docker` daemon will make the ownership of
   122  the Unix socket read/writable by the `docker` group when the daemon
   123  starts. The `docker` daemon must always run as the root user, but if you
   124  run the `docker` client as a user in the `docker` group then you don't
   125  need to add `sudo` to all the client commands. From Docker 0.9.0 you can
   126  use the `-G` flag to specify an alternative group.
   127  
   128  > **Warning**:
   129  > The `docker` group (or the group specified with the `-G` flag) is
   130  > `root`-equivalent; see [*Docker Daemon Attack Surface*](
   131  > /articles/security/#docker-daemon-attack-surface) details.
   132  
   133  **Example:**
   134  
   135      # Add the docker group if it doesn't already exist.
   136      $ sudo groupadd docker
   137  
   138      # Add the connected user "${USER}" to the docker group.
   139      # Change the user name to match your preferred user.
   140      # You may have to logout and log back in again for
   141      # this to take effect.
   142      $ sudo gpasswd -a ${USER} docker
   143  
   144      # Restart the Docker daemon.
   145      $ sudo service docker restart
   146  
   147  
   148  ## What next?
   149  
   150  Continue with the [User Guide](/userguide/).