You can Watch all our Tutorials and Training Videos for Free on ourYouTube Channel

How to Install Docker on Ubuntu 18.04 - Docker Tutorial

install docker on ubuntu, docker installation on ubuntu, docker tutorial, docker installation ubuntu, install docker commands, docker cli install
This tutorial post will show you How to Install Docker on Ubuntu 18.04 with step by step procedure. End of this post, you will be able to understand how to install docker on Ubuntu 18.04.

Steps involved in this Docker Installation,
1. How to enable repository for docker?
2. How to Deploy Docker’s official GPG key?
3. How to Install Docker using apt-get command?
4. How to Verify Docker information?In the previous posts, already we have explained the below topics. Refer those links to understand this topic from basics.

What is Docker - Get Started from Basics - Docker Tutorial
What is Container, What is Docker on Container - Get Started
How to Install Docker on CentOS 7 / RHEL 7
Docker Images Explained with Examples - Docker Tutorial
Dockerfile Instructions Explained with Examples
How to Write Dockerfile To Build Your Own Docker Images
Docker ONBUILD Command Explained with Examples
Docker ARG vs ENV Command Differences Explained in Detail
Docker CMD & ENTRYPOINT Differences Explained in Detail

How to Install Docker on Ubuntu 18.04

Lets get started.

How to Install Docker on Ubuntu 18.04

1. How to enable repository for docker?

On Ubuntu 18.04:
Before installing docker on ubuntu, update the packages index using the 'apt-get update' command as below.

sudo apt-get update

Hit:1 bionic InRelease
Hit:2 bionic-security InRelease
Hit:3 bionic-updates InRelease
Reading package lists... Done

Once you have updated your packages index, lets deploy the Docker’s official GPG key and install Docker.

sudo curl -fsSL | sudo apt-key add -


Now, enable the repository.

sudo add-apt-repository    "deb [arch=amd64]
$(lsb_release -cs)

Get:1 bionic InRelease [64.4 kB]
Hit:2 bionic InRelease
Get:3 bionic/stable amd64 Packages [2,033 B]
Hit:4 bionic-security InRelease
Hit:5 bionic-updates InRelease
Fetched 66.5 kB in 1s (97.1 kB/s)
Reading package lists... Done

2. How to Install Docker on Ubuntu 18.04?

Use "apt-get install" command to install docker with required dependencies automatically.

sudo apt-get install


Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
bridge-utils cgroupfs-mount ubuntu-fan
Suggested packages:
aufs-tools debootstrap docker-doc rinse zfs-fuse | zfsutils
The following NEW packages will be installed:
bridge-utils cgroupfs-mount ubuntu-fan
0 upgraded, 4 newly installed, 0 to remove and 55 not upgraded.
Need to get 30.1 MB of archives.
After this operation, 137 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 bionic/main amd64 bridge-utils amd64 1.5-15ubuntu1 [30.1 kB]
Get:2 bionic/universe amd64 cgroupfs-mount all 1.4 [6,320 B]
Get:3 bionic/universe amd64 amd64 17.12.1-0ubuntu1 [30.1 MB]
Get:4 bionic/main amd64 ubuntu-fan all 0.12.10 [34.7 kB]
Fetched 30.1 MB in 33s (924 kB/s)
Preconfiguring packages ...
Selecting previously unselected package bridge-utils.
(Reading database ... 174991 files and directories currently installed.)
Preparing to unpack .../bridge-utils_1.5-15ubuntu1_amd64.deb ...
Unpacking bridge-utils (1.5-15ubuntu1) ...
Selecting previously unselected package cgroupfs-mount.
Preparing to unpack .../cgroupfs-mount_1.4_all.deb ...
Unpacking cgroupfs-mount (1.4) ...
Selecting previously unselected package
Preparing to unpack .../docker.io_17.12.1-0ubuntu1_amd64.deb ...
Unpacking (17.12.1-0ubuntu1) ...
Selecting previously unselected package ubuntu-fan.
Preparing to unpack .../ubuntu-fan_0.12.10_all.deb ...
Unpacking ubuntu-fan (0.12.10) ...
Setting up (17.12.1-0ubuntu1) ...
Adding group `docker' (GID 128) ...
Created symlink /etc/systemd/system/ â /lib/systemd/system/docker.socket.
Processing triggers for ureadahead (0.100.0-20) ...
Setting up cgroupfs-mount (1.4) ...
Setting up bridge-utils (1.5-15ubuntu1) ...
Setting up ubuntu-fan (0.12.10) ...
Created symlink /etc/systemd/system/ â /lib/systemd/system/ubuntu-fan.service.
Processing triggers for systemd (237-3ubuntu10.3) ...
Processing triggers for man-db (2.8.3-2) ...
Processing triggers for ureadahead (0.100.0-20) ...

We have successfully installed docker as expected. Lets verify the docker information.

4. How to Verify Docker information?

Use below docker command with "-v" option to know the docker package version with build release information.

docker -v


Docker version 17.12.1-ce, build 7390fc6

Also we can use "version" argument along with docker command to know the relevant information about the docker package.

sudo docker version


Version:       17.12.1-ce
API version:   1.35
Go version:    go1.10.1
Git commit:    7390fc6
Built: Wed Apr 18 01:23:11 2018
OS/Arch:       linux/amd64
Version:      17.12.1-ce
API version:  1.35 (minimum version 1.12)
Go version:   go1.10.1
Git commit:   7390fc6
Built:        Wed Feb 28 17:46:05 2018
OS/Arch:      linux/amd64
Experimental: false

That's all about the Installation of Docker on Ubuntu 18.04, Its pretty straight forward. Hope you have got an idea how to install docker on Ubuntu. Going forward, we will play more with docker tool.
If you are interested in learning, Request you to go through the below recommended tutorial.
Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.
whatsapp logo