How To Install and Use Docker on Ubuntu 16.04?

Docker is the world’s leading software container platform. Developers use Docker to eliminate “works on my machine” problems when collaborating on code with co-workers. Operators use Docker to run and manage apps side-by-side in isolated containers to get better compute density.

Enterprises use Docker to build agile software delivery pipelines to ship new features faster, more securely and with confidence for both Linux and Windows Server apps.

Now let’s do the installation by this tutorial step by step.

1. Before we start our installation we need to get sure that all our Linux packages are up to date, and we can do this through the below command.

sudo apt-get update

update 1

2. Use the below command to add GPG key for the official Docker repository to the system.

sudo apt-key adv –keyserver hkp://p80.pool.sks-keyservers.net:80 –recv-keys 58118E89F3A912897C070ADBF76221572C52609D

add the key

3. Now, Let’s add the Docker repository to “APT” sources, by using the below command.

echo “deb https://apt.dockerproject.org/repo ubuntu-xenial main” | sudo tee /etc/apt/sources.list.d/docker.list

dev bla bla

4. Let’s update the packages again, using below command.

sudo apt-get update

5. You have to make sure that you are installing from the Docker Repository, to verify that, use the below command.

apt-cache policy docker-engine

docker engine

6. Time to install “Docker-Engine”, we can install it through the below command on “Terminal”.

sudo apt-get install -y docker-engine

docker install

7. Once the installation is done, we can check the status of Docker by the below command on “Terminal”.

sudo systemctl status docker

status

8. Use the below command, to start “Docker” service.

sudo service docker start

start docker

9. To know all the commands and subcommands of “Docker”, just write “Docker” on “Terminal”, like the below image, and it will display all the commands.

cmds

10. You can dig for images that are available on “Docker Hub” by using the below command.

img

After this tutorial, you should be able to understand how you can install and use “Docker” on Ubuntu Linux 16.04.

Leave a Reply