github.com/portworx/docker@v1.12.1/docs/installation/linux/debian.md (about) 1 <!--[metadata]> 2 +++ 3 aliases = [ "/engine/installation/debian/"] 4 title = "Installation on Debian" 5 description = "Instructions for installing Docker on Debian." 6 keywords = ["Docker, Docker documentation, installation, debian"] 7 [menu.main] 8 parent = "engine_linux" 9 weight=-2 10 +++ 11 <![end-metadata]--> 12 13 # Debian 14 15 Docker is supported on the following versions of Debian: 16 17 - [*Debian testing stretch (64-bit)*](#debian-wheezy-stable-7-x-64-bit) 18 - [*Debian 8.0 Jessie (64-bit)*](#debian-jessie-80-64-bit) 19 - [*Debian 7.7 Wheezy (64-bit)*](#debian-wheezy-stable-7-x-64-bit) (backports required) 20 21 >**Note**: If you previously installed Docker using `APT`, make sure you update 22 your `APT` sources to the new `APT` repository. 23 24 ## Prerequisites 25 26 Docker requires a 64-bit installation regardless of your Debian version. 27 Additionally, your kernel must be 3.10 at minimum. The latest 3.10 minor 28 version or a newer maintained version are also acceptable. 29 30 Kernels older than 3.10 lack some of the features required to run Docker 31 containers. These older versions are known to have bugs which cause data loss 32 and frequently panic under certain conditions. 33 34 To check your current kernel version, open a terminal and use `uname -r` to 35 display your kernel version: 36 37 $ uname -r 38 39 Additionally, for users of Debian Wheezy, backports must be available. To enable backports in Wheezy: 40 41 1. Log into your machine and open a terminal with `sudo` or `root` privileges. 42 43 2. Open the `/etc/apt/sources.list.d/backports.list` file in your favorite editor. 44 45 If the file doesn't exist, create it. 46 47 3. Remove any existing entries. 48 49 4. Add an entry for backports on Debian Wheezy. 50 51 An example entry: 52 53 deb http://http.debian.net/debian wheezy-backports main 54 55 5. Update package information: 56 57 $ apt-get update 58 59 ### Update your apt repository 60 61 Docker's `APT` repository contains Docker 1.7.1 and higher. To set `APT` to use 62 from the new repository: 63 64 1. If you haven't already done so, log into your machine as a user with `sudo` or `root` privileges. 65 66 2. Open a terminal window. 67 68 3. Purge any older repositories. 69 70 $ apt-get purge "lxc-docker*" 71 $ apt-get purge "docker.io*" 72 73 4. Update package information, ensure that APT works with the `https` method, and that CA certificates are installed. 74 75 $ apt-get update 76 $ apt-get install apt-transport-https ca-certificates 77 78 5. Add the new `GPG` key. 79 80 $ apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D 81 82 6. Open the `/etc/apt/sources.list.d/docker.list` file in your favorite editor. 83 84 If the file doesn't exist, create it. 85 86 7. Remove any existing entries. 87 88 8. Add an entry for your Debian operating system. 89 90 The possible entries are: 91 92 - On Debian Wheezy 93 94 deb https://apt.dockerproject.org/repo debian-wheezy main 95 96 - On Debian Jessie 97 98 deb https://apt.dockerproject.org/repo debian-jessie main 99 100 - On Debian Stretch/Sid 101 102 deb https://apt.dockerproject.org/repo debian-stretch main 103 104 > **Note**: Docker does not provide packages for all architectures. To install docker on 105 > a multi-architecture system, add an `[arch=...]` clause to the entry. Refer to the 106 > [Debian Multiarch wiki](https://wiki.debian.org/Multiarch/HOWTO#Setting_up_apt_sources) 107 > for details. 108 109 9. Save and close the file. 110 111 10. Update the `APT` package index. 112 113 $ apt-get update 114 115 11. Verify that `APT` is pulling from the right repository. 116 117 $ apt-cache policy docker-engine 118 119 From now on when you run `apt-get upgrade`, `APT` pulls from the new apt repository. 120 121 ## Install Docker 122 123 Before installing Docker, make sure you have set your `APT` repository correctly as described in the prerequisites. 124 125 1. Update the `APT` package index. 126 127 $ sudo apt-get update 128 129 2. Install Docker. 130 131 $ sudo apt-get install docker-engine 132 133 5. Start the `docker` daemon. 134 135 $ sudo service docker start 136 137 6. Verify `docker` is installed correctly. 138 139 $ sudo docker run hello-world 140 141 This command downloads a test image and runs it in a container. When the 142 container runs, it prints an informational message. Then, it exits. 143 144 145 ## Giving non-root access 146 147 The `docker` daemon always runs as the `root` user and the `docker` 148 daemon binds to a Unix socket instead of a TCP port. By default that 149 Unix socket is owned by the user `root`, and so, by default, you can 150 access it with `sudo`. 151 152 If you (or your Docker installer) create a Unix group called `docker` 153 and add users to it, then the `docker` daemon will make the ownership of 154 the Unix socket read/writable by the `docker` group when the daemon 155 starts. The `docker` daemon must always run as the root user, but if you 156 run the `docker` client as a user in the `docker` group then you don't 157 need to add `sudo` to all the client commands. From Docker 0.9.0 you can 158 use the `-G` flag to specify an alternative group. 159 160 > **Warning**: 161 > The `docker` group (or the group specified with the `-G` flag) is 162 > `root`-equivalent; see [*Docker Daemon Attack Surface*](../../security/security.md#docker-daemon-attack-surface) details. 163 164 **Example:** 165 166 # Add the docker group if it doesn't already exist. 167 $ sudo groupadd docker 168 169 # Add the connected user "${USER}" to the docker group. 170 # Change the user name to match your preferred user. 171 # You may have to logout and log back in again for 172 # this to take effect. 173 $ sudo gpasswd -a ${USER} docker 174 175 # Restart the Docker daemon. 176 $ sudo service docker restart 177 178 ## Upgrade Docker 179 180 To install the latest version of Docker with `apt-get`: 181 182 $ apt-get upgrade docker-engine 183 184 ## Uninstall 185 186 To uninstall the Docker package: 187 188 $ sudo apt-get purge docker-engine 189 190 To uninstall the Docker package and dependencies that are no longer needed: 191 192 $ sudo apt-get autoremove --purge docker-engine 193 194 The above commands will not remove images, containers, volumes, or user created 195 configuration files on your host. If you wish to delete all images, containers, 196 and volumes run the following command: 197 198 $ rm -rf /var/lib/docker 199 200 You must delete the user created configuration files manually. 201 202 ## What next? 203 204 Continue with the [User Guide](../../userguide/index.md).