How To Install and Use Docker on Ubuntu 16.04

So I recently got introduced to Tensor Flow and a whole lot of other platforms that requires me to install Docker on my machine, and yeah had a bit of challenges finding the right resources to make my journey, then came this tutorial I found on Digital Ocean community, awesome stuff!!! #UnsongHero… Lol
And just incase you wondering what Docker is, here is a brief definition:

Docker is an application that makes it simple and easy to run application processes in a container, which are like virtual machines, only more portable, more resource-friendly, and more dependent on the host operating system.

Okay now since we done with that, we may get to installing Docker…

Step 1 — Installing Docker


The Docker installation package available in the official Ubuntu 16.04 repository may not be the latest version. To get the latest and greatest version, install Docker from the official Docker repository. This section shows you how to do just that.

But first, let’s update the package database:

sudo apt-get update

Now let’s install Docker. Add the GPG key for the official Docker repository to the system:

sudo apt-key adv --keyserver hkp:// --recv-keys 58118E89F3A912897C070ADBF76221572C52609D

Add the Docker repository to APT sources:

sudo apt-add-repository 'deb ubuntu-xenial main'

Update the package database with the Docker packages from the newly added repo:

sudo apt-get update

Make sure you are about to install from the Docker repo instead of the default Ubuntu 16.04 repo:

apt-cache policy docker-engine

You should see output similar to the follow:

Output of apt-cache policy docker-engine
  Installed: (none)
  Candidate: 1.11.1-0~xenial
  Version table:
     1.11.1-0~xenial 500
        500 ubuntu-xenial/main amd64 Packages
     1.11.0-0~xenial 500
        500 ubuntu-xenial/main amd64 Packages

Notice that docker-engine is not installed, but the candidate for installation is from the Docker repository for Ubuntu 16.04. The docker-engine version number might be different.

Finally, install Docker:

sudo apt-get install -y docker-engine

Docker should now be installed, the daemon started, and the process enabled to start on boot. Check that it’s running:

sudo systemctl status docker

The output should be similar to the following, showing that the service is active and running:

● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2016-05-01 06:53:52 CDT; 1 weeks 3 days ago
 Main PID: 749 (docker)

Installing Docker now gives you not just the Docker service (daemon) but also the docker command line utility, or the Docker client.

Hope you found that useful and thanks to Digital Ocean community for the resources. And for the next tutorial we will explore how to use the docker command.



3 thoughts on “How To Install and Use Docker on Ubuntu 16.04

  1. [ Smiles ] Thanking you for providing me with these codes.

    I am speculating that these very codes should also work on Linux Mint (Which is what I am currently using).

    • Hey Renard, Thank you for your comment, while I’ve used it on my version of Ubuntu, I’m not too sure which other versions it’ll work on, but please do give it a try.

  2. Pingback: How To Install and Use Docker on Ubuntu 16.04 – Part 4 and 5 | StrAngEr oN eArtH

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s