Menu

How to install Docker on Ubuntu 16.04

Introduction

Docker is software containerization platform which makes it easier to create, deploy, and run applications by using containers. It's the most popular containerization platform in our days. More details about Docker could be found on Docker official web site or Wikipedia.

This tutorial describes only how to install Docker on Ubuntu 16.04. Installation process on other distribution looks very similar but can have some differences. How to use Docker will be described into future tutorials.

Before Installation

All listed commands below should be run in terminal (console) by user with sudo privileges.
To install/remove packages I prefer to use aptitude (is not installed by default anymore on Ubuntu) command instead of apt-get. In case when aptitude is not installed or for some other reasons apt-get can be used. (apt-get installed by default on Ubuntu)

In this tutorial we will install Docker form Docker repositories, not from Ubuntu repositories.

Update packages

Before installing any new package on Ubuntu it's better to have up to date system. It will allow us to avoid issues with package dependencies and errors during installation.
To update packages and upgrade system:

As you probably notices the previous command (version verification) is run with sudo privileges. To run Docker commands without sudo we need to add our user (or user who will run docker commands) to the docker group into the following way:

sudo usermod -aG docker $(whoami)

$(whoami) prints current user. To add another user to docker group $(whoami) should be replaced by username.