Guides
Working with Docker
Install Docker on Ubuntu or Debian
8min
installing docker on ubuntu or debian only takes a few commands this should all take only a few minutes let's dive in 1\ remove docker first, you need to remove any docker dependencies (if you've never installed docker before, don't worry you can skip this step ) $ sudo apt get remove docker docker engine docker io containerd runc 2\ set up the repository now we need to set up the docker repository, add the official gpg key, and verify it $ sudo apt get update $ sudo apt get install \\ apt transport https \\ ca certificates \\ curl \\ gnupg agent \\ software properties common next, we add the gpgkey $ curl fssl https //download docker com/linux/debian/gpg | sudo apt key add now, we need to verify the fingerprint and check it matches this 9dc8 5822 9fc7 dd38 854a e2d8 8d81 803c 0ebf cd88 $ sudo apt key fingerprint 0ebfcd88 pub 4096r/0ebfcd88 2017 02 22 key fingerprint = 9dc8 5822 9fc7 dd38 854a e2d8 8d81 803c 0ebf cd88 uid docker release (ce deb) \<docker\@docker com> sub 4096r/f273fcd8 2017 02 22 if that's all good, we add the docker repository $ sudo add apt repository \\ "deb \[arch=amd64] https //download docker com/linux/ubuntu \\ $(lsb release cs) \\ stable" 3\ install docker okay, now that we've got the repository set up and verified, it's time to install docker $ sudo apt get update $ sudo apt get install docker ce docker ce cli containerd io at this point, it's good to start a container to check that docker installed correctly $ sudo docker run hello world 4\ add non root users you'll notice that if you want to start docker as a non root user, you'll probably run into this error message got permission denied while trying to connect to the docker daemon socket at unix ///var/run/docker sock get http //%2fvar%2frun%2fdocker sock/v1 40/containers/json dial unix /var/run/docker sock connect permission denied don't worry there's an easy fix for that first, create the docker group $ sudo groupadd docker then add the non root user to the group $ sudo usermod ag docker $user with all that done, you've got docker set up and ready to use