How to Install Docker Desktop on Linux Mint.

How to install Docker Desktop on Linux Mint

Recently, I started hosting some services on my laptop. Now, I got Home Assistant Core, Shariport-sync, and Scrypted installed as system-wide software.

I may install other services in the future. So, I think it's time to use Docker to run all these services instead of a local installation that may interfere with others.

I believe Docker started pushing everyone to use Docker Desktop, so let's try it out. My laptop runs Linux Mint 21.1, and the following article will follow the Docker documentation "Install Docker Desktop on Linux" guide.

Check KVM virtualization support. (Optional)

The Docker Desktop runs a virtual machine that requires KVM support from the host or operating system. I believe most of the modern Linux distros have virtualization support. It should be loaded KVM Module automatically.

To load the KVM Module manual, you can execute this command.

$ modprobe kvm

Loading the KVM module depends on the processor of your machine.

$ modprobe kvm_intel  # Intel processors
	# or
$ modprobe kvm_amd    # AMD processors

For any issue, you can view the diagnostics by this command.

$ kvm-ok

Run this command to check whether the KVM modules are enabled.

$ lsmod | grep kvm

Set the KVM device user permissions.

Run this command to check the /dev/kvm 's ownership.

$ ls -al /dev/kvm

In order to access the KVM device, we need to add the user into kvm group.

$ sudo usermod -aG kvm $USER

Log out and log back in to let the system take effect on the changes.

Install Docker Desktop

Linux Mint is a Linux distribution based on Ubuntu. For that reason, here I will follow the Installation guide for Ubuntu.

Install gnome-terminal.

To install Docker Desktop, we need the gnome-terminal. Since I'm using the Cinnamon desktop environment, which it's derived from Gnome 3 already included the terminal.

You can run this command to install gnome-terminal just in case you are in a different desktop environment.

$ sudo apt install gnome-terminal

Set up Docker's package repository.

Update the package index and install packages to allow apt to use the repository over HTTPS:

$ sudo apt-get update
$ sudo apt-get install \
    ca-certificates \
    curl \
    gnupg

Add Docker's Official GPG Key

$ sudo install -m 0755 -d /etc/apt/keyrings
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
$ sudo chmod a+r /etc/apt/keyrings/docker.gpg

Execute the command below to set up the repository.

echo \
  "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

In my case, I should change the $VERSION_CODENAME variable to the corresponding Ubuntu codename(Refer here). Linux Mint 21.1 using Ubuntu 22.04 LTS as the base. Therefore, The $VERSION_CODENAME should change to Jammy instead of Vera.

Download the latest DEB package.

Link: https://desktop.docker.com/linux/main/amd64/docker-desktop-4.18.0-amd64.deb?utm_source=docker&utm_medium=webreferral&utm_campaign=docs-driven-download-linux-amd64

Now, We can update the package index and install the DEB package.

$ sudo apt-get update
$ sudo apt-get install ./docker-desktop-<version>-<arch>.deb

After the installation, we can use the terminal to run the Docker Desktop and enable Docker Desktop to start on login.

$ systemctl --user start docker-desktop
$ systemctl --user enable docker-desktop

That's all for the installation. Install Docker Desktop on Linux is not direct or intuitive as Windows and macOS. However, I hope this article can help.

**After some trial and error, I decided to ditch Docker Desktop and switch to Docker Engine. It's easier and more command line to use.

Next Post Previous Post
No Comment
Add Comment
comment url