github.com/mheon/docker@v0.11.2-0.20150922122814-44f47903a831/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 If you need to add an HTTP Proxy, set a different directory or partition for the 43 Docker runtime files, or make other customizations, read our Systemd article to 44 learn how to [customize your Systemd Docker daemon options](/articles/systemd/). 45 46 > **Note**: 47 > If you want to enable memory and swap accounting see 48 > [this](/installation/ubuntulinux/#adjust-memory-and-swap-accounting). 49 50 ### Uninstallation 51 52 To uninstall the Docker package: 53 54 $ sudo apt-get purge docker.io 55 56 To uninstall the Docker package and dependencies that are no longer needed: 57 58 $ sudo apt-get autoremove --purge docker.io 59 60 The above commands will not remove images, containers, volumes, or user created 61 configuration files on your host. If you wish to delete all images, containers, 62 and volumes run the following command: 63 64 $ rm -rf /var/lib/docker 65 66 You must delete the user created configuration files manually. 67 68 ## Debian Wheezy/Stable 7.x (64-bit) 69 70 Docker requires Kernel 3.8+, while Wheezy ships with Kernel 3.2 (for more details 71 on why 3.8 is required, see discussion on 72 [bug #407](https://github.com/docker/docker/issues/407)). 73 74 Fortunately, wheezy-backports currently has [Kernel 3.16 75 ](https://packages.debian.org/search?suite=wheezy-backports§ion=all&arch=any&searchon=names&keywords=linux-image-amd64), 76 which is officially supported by Docker. 77 78 ### Installation 79 80 1. Install Kernel from wheezy-backports 81 82 Add the following line to your `/etc/apt/sources.list` 83 84 `deb http://http.debian.net/debian wheezy-backports main` 85 86 then install the `linux-image-amd64` package (note the use of 87 `-t wheezy-backports`) 88 89 $ sudo apt-get update 90 $ sudo apt-get install -t wheezy-backports linux-image-amd64 91 92 2. Restart your system. This is necessary for Debian to use your new kernel. 93 94 3. Install Docker using the get.docker.com script: 95 96 `curl -sSL https://get.docker.com/ | sh` 97 98 >**Note**: If your company is behind a filtering proxy, you may find that the 99 >`apt-key` 100 >command fails for the Docker repo during installation. To work around this, 101 >add the key directly using the following: 102 > 103 > $ curl -sSL https://get.docker.com/gpg | sudo apt-key add - 104 105 ### Uninstallation 106 107 To uninstall the Docker package: 108 109 $ sudo apt-get purge docker-engine 110 111 To uninstall the Docker package and dependencies that are no longer needed: 112 113 $ sudo apt-get autoremove --purge docker-engine 114 115 The above commands will not remove images, containers, volumes, or user created 116 configuration files on your host. If you wish to delete all images, containers, 117 and volumes run the following command: 118 119 $ rm -rf /var/lib/docker 120 121 You must delete the user created configuration files manually. 122 123 ## Giving non-root access 124 125 The `docker` daemon always runs as the `root` user and the `docker` 126 daemon binds to a Unix socket instead of a TCP port. By default that 127 Unix socket is owned by the user `root`, and so, by default, you can 128 access it with `sudo`. 129 130 If you (or your Docker installer) create a Unix group called `docker` 131 and add users to it, then the `docker` daemon will make the ownership of 132 the Unix socket read/writable by the `docker` group when the daemon 133 starts. The `docker` daemon must always run as the root user, but if you 134 run the `docker` client as a user in the `docker` group then you don't 135 need to add `sudo` to all the client commands. From Docker 0.9.0 you can 136 use the `-G` flag to specify an alternative group. 137 138 > **Warning**: 139 > The `docker` group (or the group specified with the `-G` flag) is 140 > `root`-equivalent; see [*Docker Daemon Attack Surface*]( 141 > /articles/security/#docker-daemon-attack-surface) details. 142 143 **Example:** 144 145 # Add the docker group if it doesn't already exist. 146 $ sudo groupadd docker 147 148 # Add the connected user "${USER}" to the docker group. 149 # Change the user name to match your preferred user. 150 # You may have to logout and log back in again for 151 # this to take effect. 152 $ sudo gpasswd -a ${USER} docker 153 154 # Restart the Docker daemon. 155 $ sudo service docker restart 156 157 158 ## What next? 159 160 Continue with the [User Guide](/userguide/).