Installing Docker on Ubuntu 16.04

Posted on Wednesday, April 5, 2017

I am going to do a simple install of Docker on Ubuntu 16.04

The official docker install guide for ubunt can be found at

I will be installed Docker CE (Community Edition) not Docker EE (Enterprise Edition)


Update apt-get and install extra tools

  > sudo apt-get update
  > sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \

Add the docker official GPG key

  > curl -fsSL \ | sudo apt-key add -

Add the docker repo

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

Update again and install docker

  > sudo apt-get update
  > sudo apt-get install docker-ce -y

That's it! 


Now test it real quick

  > sudo docker run hello-world


Let me done something a little more interesting as a test.

  >  sudo docker run -p 8080:80 nginx

This should download the nginx docker image and runs it locally and connects its port 80 to local port 8080.

Then from another terminal run this

  >  curl localhost:8080

You should get back a web page. 

And there is the docker logs from the running docker nginx image.

Or you could open the URL directly   (replace with your IP address of course)

OK that is enough for this simple article. Docker is installed tested.


[1]        Install Docker on Ubuntu guide

No comments:

Post a Comment