Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Quick Install for Docker on Debian (LMDE, Mint, Ubuntu, etc)
# Quick Install for Docker on Debian (LMDE, Mint, Ubuntu, etc)
# Author: Benjamin H. Graham <>
# Usage: curl -s | bash
# Add debian repo
echo "Adding the debian repository for docker"
echo deb docker main | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-key adv --keyserver --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
echo "Updating apt repos"
sudo apt-get update -qq
echo "Installing docker"
sudo apt-get install -y lxc-docker
echo "Enabling current user to use docker"
sudo groupadd docker
# Add the connected user "${USER}" to the docker group.
# Change the user name to match your preferred user.
# You may have to logout and log back in again for
# this to take effect.
sudo gpasswd -a ${USER} docker
echo 'DOCKER_OPTS="--dns --dns -H tcp:// -H unix:///var/run/docker.sock"'| sudo tee /etc/default/docker
echo "export DOCKER_HOST=tcp://" | sudo tee /etc/profile;
# Restart the Docker daemon.
echo "Restarting docker daemon"
sudo service docker restart
echo "Testing docker with hello-world";
export DOCKER_HOST=tcp://;
docker -H tcp:// run hello-world;
echo "You should see a hello world message above.";
echo "You will need to logout and back in to use docker. Otherwise run this: ";
echo "DOCKER_HOST=tcp://";
echo "Or you can test again with this: ";
echo "docker -H tcp:// run hello-world";

This comment has been minimized.

Copy link

ivdunin commented Sep 27, 2016

You should use 'tee -a' in line 22.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.