Ubuntu 16.04 - Install Docker

Install Using PPA

Using a PPA will allow you to always use the latest version of Docker without waiting on the Ubuntu package maintainers. Normally I would recommend installing from the Ubuntu Repos, but with docker this method is what I recommend.

This works on Ubuntu Server 16.04 but appears to have issues on the Desktop version of the distribution but this could be specific to how I set up my desktops.

Run the command below to install Docker.

curl -s https://scripts.programster.org/scripts/7?output=raw | bash

... or you can execute the following script:

#!/bin/bash
sudo apt-get update -y
sudo apt-get install apt-transport-https ca-certificates -y

sudo apt-key adv \
--keyserver hkp://p80.pool.sks-keyservers.net:80 \
--recv-keys 58118E89F3A912897C070ADBF76221572C52609D

echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" \
| sudo tee /etc/apt/sources.list.d/docker.list


sudo apt-get update
sudo apt-get purge lxc-docker

sudo apt-get install -y docker-engine

# Add the current user to docker so that you can
# execute docker commands without using sudo
sudo usermod -aG docker $USER

echo "You will need to reboot before using docker."

Install From Ubuntu Repos

sudo apt update && sudo apt install docker.io -y

# Add our current user to the docker group so they can execute docker commands.
sudo usermod -a -G docker $USER

This will install version 1.10.3 at the time of writing this tutorial.

References

Author

Programster

Stuart is a software developer with a passion for Linux and open source projects.

comments powered by Disqus