How to Install Docker Desktop on Ubuntu 22.04/Ubuntu 20.04

0
16

How can you install Docker desktop on Linux? In this tutorial, you will learn how to install Docker desktop on Ubuntu 22.04/Ubuntu 20.04. Docker Desktop is an easy-to-install program for Mac, Linux, or Windows environments. You may create and distribute containerized applications and microservices using it. Without needing to utilize the CLI to carry out essential tasks, it offers a straightforward interface that lets you manage your containers, apps, and images from your machine.

How to Install Docker Desktop on Ubuntu 22.04/Ubuntu 20.04

The steps below outline how to Docker Desktop on Linux, specifically Ubuntu 22.04/Ubuntu 20.04.

Begin by checking the requirements for installing Docker Desktop.

Install Docker on Linux (Ubuntu 22.04/Ubuntu 20.04)

Once you have all the requirements in place;

  • Update your system packages.
sudo apt update
  • Run the following command to install the required packages.
sudo apt -y install apt-transport-https ca-certificates curl software-properties-common
  • Next, add the Docker repository using the command below.
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \
sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/docker-archive-keyring.gpg
echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | \
sudo tee /etc/apt/sources.list.d/docker.list
  • Then install Docker.
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io uidmap
  • Ensure Docker service is running;
systemctl status docker

If not running, start it;

sudo systemctl start docker
  • After the Docker installation, add your user account to the docker group using the following command.
sudo usermod -aG docker $USER

How to Install Docker Desktop on Ubuntu 22.04/Ubuntu 20.04

  • Navigate to the Docker Desktop download page and get the latest Linux DEB download link and download it using wget the command as shown below.
wget https://desktop.docker.com/linux/main/amd64/docker-desktop-4.16.2-amd64.deb
  • Install Docker Desktop using the following command.
sudo apt install ./docker-desktop-*-amd64.deb
  • To check the version of the binaries run the following commands.
docker compose version
docker --version
docker version

Sample output

Client: Docker Engine - Community
 Cloud integration: v1.0.29
 Version:           20.10.22
 API version:       1.41
 Go version:        go1.18.9
 Git commit:        3a2c30b
 Built:             Thu Dec 15 22:28:04 2022
 OS/Arch:           linux/amd64
 Context:           desktop-linux
 Experimental:      true

Server: Docker Desktop 4.16.1 (95567)
 Engine:
  Version:          20.10.22
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.18.9
  Git commit:       42c8b31
  Built:            Thu Dec 15 22:26:14 2022
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.14
  GitCommit:        9ba4b250366a5ddde94bb7c9d1def331423aa323
 runc:
  Version:          1.1.4
  GitCommit:        v1.1.4-0-g5fd4c4d
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
  • After the installation, launch Docker Desktop from the application menu as shown below.
  • And that is it on how to install Docker Desktop on Ubuntu. You can also launch Docker Desktop from the terminal using the command below.
systemctl --user start docker-desktop
  • To start Docker Desktop on system boot up run the command below.
systemctl --user enable docker-desktop
  • Similarly, you can run the following command to stop Docker Desktop.
systemctl --user stop docker-desktop
  • Click the Accept button as shown below to accept the service agreement.
  • Wait for it to start.
  • If you decided to run Docker desktop on VirtualBox VM, be sure to enable nested virtualization for that specific VM. Otherwise, when you try to start Docker Desktop, you will see Docker Desktop stopped…
  • To enable nested virtualization for specific VM, poweroff the VM and run;
vboxmanage modifyvm <vm-name> --nested-hw-virt on

Or;

Docker Desktop stopped... enable nested virtualization
  • After starting the tutorial page will pop up.
  • You can either choose to go through the tutorial or skip.
  • Then you will be redirected to the Containers page after skipping or going through the tutorial.

Running containers

  • On the home page, we will run the Redis container as an example. You can as well copy the example docker run command and execute it on the terminal.
  • To run Redis container under guides, click on Run option and then select the directory where Docker will store static content.
  • When you click Run, the container images will be pulled and Docker container created over it.
sample redis docker container
  • You can view container logs, inspect it, open the terminal for the container, check metrics e.t.c
  • You can search the images from Docker hub and run containers using them;
search docker images
  • Containers can be managed from the containers tab.
  • The images can be managed from the image tab.

Configure Docker Desktop on Ubuntu 22.04/Ubuntu 20.04

  • Click on the setting icon as shown below.

General tab

  • You can configure Docker Desktop to start when you log in from the settings menu.
  • Alternatively, you can use the command
systemctl --user enable docker-desktop 
  • Choose a theme for Docker Desktop.
  • Show weekly tips which are simply recommendations.
  • Open Docker Dashboard at startup
  • Enable Docker Compose V1/V2 compatibility mode which allows you to switch between V1 or V2.
docker desktop general settings
Install and Configure Docker Desktop on Ubuntu

Resources tab

  • On the resource tab, you can limit resources according to your preference, configure file sharing, and configure proxies and networks.
  • Other configurations are available on the settings option such as Docker Engine, Kubernetes, Software updates, Extensions, etc.
docker desktop resource settings
Install and Configure Docker Desktop on Ubuntu

How to Uninstall Docker Desktop on Ubuntu 22.04/Ubuntu 20.04

  • To remove Docker Desktop from Ubuntu run the command below.
sudo apt remove --purge --auto-remove docker-desktop
  • Delete Docker Desktop files.
rm -r $HOME/.docker/desktop
  • That concludes our article on how to install Docker Desktop on Ubuntu 22.04/20.04.

Read more on Docker Desktop Documentation

Other Tutorials

How to Install Docker Resource Usage Extension

How to Monitor Docker Containers using Nagios

How to Check Docker Container RAM and CPU Usage

LEAVE A REPLY

Please enter your comment!
Please enter your name here