Ubuntu: How do I install Docker on Ubuntu 16.04 LTS?


I would like to build and run Docker containers on Ubuntu 16.04 LTS. How do I install Docker?


Docker comes in two flavours: The Comunity Edition (CE) and the Enterprise Edition (EE). See this question for the differences. Just take Docker CE if you don't know which to take.

The Ubuntu installation instructions list all you need in detail, but in most cases it boils down to:

(1) Set up the docker repository

$ sudo apt-get update  $ sudo apt-get install apt-transport-https ca-certificates curl software-properties-common  $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -  $ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"  

(2) Install Docker CE

$ sudo apt-get update  $ sudo apt-get install docker-ce  

(3) Verify the installation

$ sudo docker run hello-world  


To install the community edition, add the GPG key

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -  

Add the docker repository

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"    sudo apt-get update  

To make sure, you're going to install docker from Docker repo,

apt-cache policy docker-ce  

Now install docker,

sudo apt-get install -y docker-ce  

It would be running by default, but you can check the status

sudo systemctl status docker  


Easiest way to install docker on Ubuntu using following command that you can get from the https://get.docker.com/

This script is meant for quick & easy install via:

$ curl -fsSL https://get.docker.com | sh  


wget -qO- https://get.docker.com/ | sh  

For test builds (ie. release candidates):

$ curl -fsSL https://test.docker.com | sh  


 wget -qO- https://test.docker.com/ | sh  

For rc build with experimental feature:

$ curl -fsSL https://experimental.docker.com | sh  


 wget -qO- https://experimental.docker.com/ | sh  


To install the Ubuntu repository version

sudo apt install docker.io  

Check the version with

docker --version  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »