This is the first step for me from old and outdated LAMP to the new “era” in containerized applications. I decided to install Docker and use it for all my websites on a test environment at first. This article is just an introduction on how to install Docker on Ubuntu LTS and Debian Stable, which will be followed by articles showing how to install Docker in CentOS and Fedora too.
Therefore, lets start and show how to install Docker. Some of the steps described below can also be found in the Docker Book, by James Turnbull.
I will install Docker CE (Community Edition) on both Ubuntu and Debian. There is also a Docker EE (Enterprise Edition) that is supported entirely by Ubuntu on all known platforms, but on Debian, there is only the community edition supported. As my servers are running Debian at this point, I am directly interested in showing you how to install and use Docker on Debian, but I will also show you how to use it in Ubuntu too. For more information on Docker’s variants, you should consult the documentation page of the Docker project. The documentation only covers installation of the Community Edition on the following Linux distributions: Ubuntu, Debian, CentOS and Fedora. Nevertheless, Docker Enterprise Edition is also supported and delivered with SUSE Linux Enterprise and Red Hat Enterprise Linux.
Installing Docker in Ubuntu 16.04 LTS
Prerequisites: 64 bit, Kernel > 3.10
Install linux-image-extra and linux-image-extra-virtual
Install Docker and some extra packages
Add the official Docker GPG key
Add the Docker repository:
Do a repository update:
Install the Docker CE (Community Edition) package:
Check to see if Docker was properly installed in Ubuntu:
This is it. Now you have Docker installed on your Ubuntu system.
Installing Docker on Debian 9 Stretch
Prerequisites: 64 bit, Kernle > 3.10 -> Debian 9 has Kernel 4.9 thus you will not have to deal with this issue.
Add the Docker’s official GPG key:
Add the Stable Docker repository:
In order to add the Docker repository, you will need to edit the
/etc/apt/sources.list file. For this, we will use the following command to add the repo:
Install Docker CE (Community Edition):
You can test to see if Docker is working properly by using the command:
The output would be:
Here you have it, Docker is installed on your Debian 9 system, too!