Programster's Blog

Tutorials focusing on Linux, programming, and open-source

Debian 8 Install Docker

Remove existing installation.

If you already have a different version of docker installed, you can run this to remove it.

sudo apt-get purge lxc-docker*
sudo apt-get purge*

Installation Script

Run the following command to get the latest version of docker through the apt repository. This requires prog-exec to have been installed.

prog-exec "17/1" "1af09e60656e0d058884e24b85b8fe387e9216e878847c6a0e461e0946b82f4e"

... or copy, paste, and execute the following script.

# Update
sudo apt-get update
sudo apt-get dist-upgrade -y

# docker requires apt-transport-https
sudo apt-get install apt-transport-https -y

# now setup the apt repository
sudo apt-key adv --keyserver hkp:// --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo echo "deb debian-jessie main" | \
sudo tee /etc/apt/sources.list.d/docker.list

# Finally install the package.
sudo apt-get update
sudo apt-get install docker-engine -y

# Start the docker service
sudo service docker start

# Add ourselves to the docker group so that we 
# can use 'docker' commands without sudo.
sudo adduser $USER docker

You now have docker installed and running. You will have to log out and in again if you want to run any of the docker commands without using sudo.


Last updated: 8th August 2020
First published: 16th August 2018