How to install Docker on Ubuntu 16.04

November 18, 2016 | By | Reply More

This tutorial will show you how to install Docker on Ubuntu 16.04. If you are new to Docker, you may want to read more about Docker on this page. You will find all information you need about Docker. Before we go through the Docker installation, we need to ensure that our system meets the Docker requirements.

install docker on ubuntu

Docker Requirements

  • 64 bit system
  • Minimum Kernel version 3.10

If you are gonna install Docker on Ubuntu 16.04, both above requirements should be full filled by default. So we can continue to the next step.

Steps to install Docker on Ubuntu 16.04

Step 1. Update APT Sources

Before we add the apt sources, we need to ensure that the APT works with https mode. So, we need to install the CA certificate.

Next, add the GPG key

 

Add the Docker repository

Now update Ubuntu repository

Verify the Docker repository

It should print something like this:

root@onlyoffice:/home/dhani# apt-cache policy docker-engine
docker-engine:
Installed: (none)
Candidate: 1.12.3-0~xenial
Version table:
1.12.3-0~xenial 500
500 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages
1.12.2-0~xenial 500
500 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages
1.12.1-0~xenial 500
500 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages
1.12.0-0~xenial 500
500 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages
1.11.2-0~xenial 500
500 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages
1.11.1-0~xenial 500
500 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages
1.11.0-0~xenial 500
500 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages

Step 2. Install Docker

Use this command to start install prerequisites file needed by Docker engine

Now install Docker with this command

Start Docker daemon

To see the docker status use, status command

Output:

root@onlyoffice:/home/dhani# service docker status
docker.service – Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2016-11-18 10:51:54 WITA; 44s ago
Docs: https://docs.docker.com
Main PID: 2539 (dockerd)
CGroup: /system.slice/docker.service
├─2539 /usr/bin/dockerd -H fd://
└─2549 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock –shim docker-containerd-shim –metrics-interval=0 –start-timeout 2m

Nov 18 10:51:53 onlyoffice dockerd[2539]: time=”2016-11-18T10:51:53.975785748+08:00″ level=warning msg=”Your kernel does not support swap memory limit.”
Nov 18 10:51:53 onlyoffice dockerd[2539]: time=”2016-11-18T10:51:53.976428611+08:00″ level=info msg=”Loading containers: start.”
Nov 18 10:51:54 onlyoffice dockerd[2539]: time=”2016-11-18T10:51:54.077890844+08:00″ level=info msg=”Firewalld running: false”
Nov 18 10:51:54 onlyoffice dockerd[2539]: time=”2016-11-18T10:51:54.360115410+08:00″ level=info msg=”Default bridge (docker0) is assigned with an IP address 172.17.0.0/
Nov 18 10:51:54 onlyoffice dockerd[2539]: time=”2016-11-18T10:51:54.554319440+08:00″ level=info msg=”Loading containers: done.”
Nov 18 10:51:54 onlyoffice dockerd[2539]: time=”2016-11-18T10:51:54.554496079+08:00″ level=info msg=”Daemon has completed initialization”
Nov 18 10:51:54 onlyoffice dockerd[2539]: time=”2016-11-18T10:51:54.554511023+08:00″ level=info msg=”Docker daemon” commit=6b644ec graphdriver=aufs version=1.12.3
Nov 18 10:51:54 onlyoffice systemd[1]: Started Docker Application Container Engine.
Nov 18 10:51:54 onlyoffice dockerd[2539]: time=”2016-11-18T10:51:54.559246954+08:00″ level=info msg=”API listen on /var/run/docker.sock”
Nov 18 10:52:32 onlyoffice systemd[1]: Started Docker Application Container Engine.

Verify the installation

Done. Now Docker is installed on Ubuntu 16.04 and ready for use.

Tags: , , ,

Category: Ubuntu

Leave a Reply