(Last Updated On: March 1, 2019)

How can I install Docker CE on Linux Mint 19?, How can I install Docker Compose on Linux Mint 19?. This guide will answer above questions by showing you a step by step installation of Docker and Docker Compose on Linux Mint 19.

Docker has been the defacto container engine since its arrival. It enables you to package and run your applications in isolated containers within a single host or cluster of Linux hosts.

Docker Engine is available in Community Edition (CE) and Enterprise Edition (EE). In this guide, we will do the installation of Docker Community Edition on Linux Mint 19 using below steps.

Step 1: Install Dependency packages

Start the installation by ensuring that all the packages used by docker as dependencies are installed.

sudo apt-get update
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common

Step 2: Add Docker’s official GPG key:

Import Docker GPG key used for signing Docker packages.

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

Step 3: Add the Docker repository to Linux Mint 19

Add Docker upstream repository to your Linux Mint 19 so you can install the latest stable release of Docker.

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(. /etc/os-release; echo "$UBUNTU_CODENAME") stable"

The command above will add a new line to additional repositories file.

$ cat /etc/apt/sources.list.d/additional-repositories.list 
deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable

Step 4: Install Docker Engine and Docker Compose in Linux Mint 19

Update the apt package index.

$ sudo apt-get update
Hit:1 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:3 http://archive.canonical.com/ubuntu bionic InRelease
Hit:4 http://security.ubuntu.com/ubuntu bionic-security InRelease
Ign:5 http://packages.linuxmint.com tessa InRelease
Hit:6 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Get:7 https://download.docker.com/linux/ubuntu bionic InRelease [64.4 kB]
Hit:8 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:9 http://packages.linuxmint.com tessa Release
Get:11 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages [3,695 B]
Fetched 68.1 kB in 2s (33.9 kB/s)
Reading package lists… Done

Then install the latest version of Docker CE and Docker Compose

sudo apt-get -y  install docker-ce docker-compose

The docker group is created but no users are added. Add your normal user to the group to run docker commands as non-privileged user.

sudo usermod -aG docker $USER

Log out and log back in so that your group membership is re-evaluated.

Run a test docker container:

$ docker run --rm -it  --name test alpine:latest /bin/sh
Unable to find image 'alpine:latest' locally
latest: Pulling from library/alpine
cd784148e348: Pull complete
Digest: sha256:46e71df1e5191ab8b8034c5189e325258ec44ea739bba1e5645cff83c9048ff1
Status: Downloaded newer image for alpine:latest

/ # cat /etc/os-release
NAME="Alpine Linux"
PRETTY_NAME="Alpine Linux v3.8"
/ # exit

You now have Docker Engine and Docker Compose installed on Linux Mint 19. Enjoy using containers to run your services.

Also relevant is Top command for container metrics