devops docker linuxIn a past episode, I tried to explain in simple words what Docker is, how does it work and why it’s good to start looking at it, if you missed my article, here is the link – Docker, nice to meet you!

Now that you are curious enough, it’s time to move a step forward and try to install it in your system. Due to the nature of the blog, I will mainly cover linux installation on different distributions, but I’ll give many information about how to install it on Windows too.

I suggest you to read my articles about packet managers if you don’t find any of the steps below 100% clear!

So..how to install docker on ubuntu-debian?

Debian, ubuntu and all debian-based distributions use APT as packet manager.  In order to start from a fresh and up-to-date situation we start the process performing an update of the packet index.

Install pre-requisites and add repository

Copy to Clipboard

Since sometimes the package provided with distro repos is not the latest available, we are going to install docker from the official repo, so we proceed installing some dependencies that allow GPG-key adding and APT to retrieve the package.

Copy to Clipboard

We proceed retrieving the GPG for official Docker repo: [ ~ !!! be careful to replace debian with ubuntu depending on the distro you are using ~]

Copy to Clipboard

We are now ready to add the repository in APT:

Copy to Clipboard

Now, our packet manager is ready to retrieve the package docker-ce, but we first need to update the sources, like we did at the beginning.

Copy to Clipboard

We need to be sure that we will retrieve the package from our freshly added repository, instead of the distro repo, so we run the following command to check the source of the package, once it is found:

Copy to Clipboard

In my case, this was the result:

Copy to Clipboard

Let’s install and start Docker!

Once the result you see is similar to the one provided above, you can the proceed to install it:

Copy to Clipboard

Verify installation and run your first container

… and now verify that all went right!

Copy to Clipboard

If everything went right, the output should be similar to the one below:

Copy to Clipboard

Congrats! Your docker installation is up and running, check out my other tutorials to move your first steps!

Additional information can be found in the offical documentation: