github.com/nf/docker@v1.8.1/docs/installation/debian.md (about)

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