Containers

Install Docker and Compose on Linux Mint

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

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 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 update
sudo apt -y install apt-transport-https ca-certificates curl software-properties-common
sudo apt -y remove docker docker-engine docker.io containerd runc

Step 2: Download Docker GPG key

Import Docker GPG key used for signing Docker packages.

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/docker-archive-keyring.gpg

The key will be added to the

Step 3: Add the Docker repository

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

  • Linux Mint 21:
echo "deb https://download.docker.com/linux/ubuntu jammy stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
  • Linux Mint 20:
echo "deb https://download.docker.com/linux/ubuntu focal stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

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

cat /etc/apt/sources.list.d/docker.list

Step 4: Install Docker and Compose Plugin

Update the apt package index.

$ sudo apt update
Hit:1 http://security.ubuntu.com/ubuntu jammy-security InRelease
Get:2 https://download.docker.com/linux/ubuntu jammy InRelease [48.9 kB]
Get:3 https://download.docker.com/linux/ubuntu jammy/stable amd64 Packages [7,756 B]
Hit:4 http://archive.ubuntu.com/ubuntu jammy InRelease
Ign:5 http://packages.linuxmint.com vanessa InRelease
Hit:6 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:7 http://packages.linuxmint.com vanessa Release
Hit:8 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Fetched 56.6 kB in 1s (112 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done

Then install the latest version of Docker CE and Docker Compose

sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin

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
newgrp docker

Check the version of docker installed

$ docker version
Client: Docker Engine - Community
 Version:           27.0.3
 API version:       1.46
 Go version:        go1.21.11
 Git commit:        7d4bcd8
 Built:             Sat Jun 29 00:02:23 2024
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          27.0.3
  API version:      1.46 (minimum version 1.24)
  Go version:       go1.21.11
  Git commit:       662f78c
  Built:            Sat Jun 29 00:02:23 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.18
  GitCommit:        ae71819c4f5e67bb4d5ae76a6b735f29cc25774e
 runc:
  Version:          1.7.18
  GitCommit:        v1.1.13-0-g58aa920
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

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
213ec9aee27d: Pull complete
Digest: sha256:bc41182d7ef5ffc53a40b044e725193bc10142a1243f395ee852a8d9730fc2ad
Status: Downloaded newer image for alpine:latest

 / # cat /etc/os-release 
 NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.16.2
PRETTY_NAME="Alpine Linux v3.16"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"

 / # exit
jkmutai@mint21:~$

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

Also relevant is Top command for container metrics

More on Docker:

Related Articles

Linux Mint How To Install IntelliJ IDEA on Linux Mint 22 Containers How To Install Podman on Debian 12 (Bookworm) Debian Install Wine 9 on Ubuntu 24.04 / Linux Mint 22 / Debian 13 Desktop How To Install Atom on Ubuntu / Linux Mint

Press ESC to close