In this tutorial, we walk you through the installation of Docker Desktop on Ubuntu 22.04.
The conventional way of running and managing Docker container images is on the command line. However, this can be a daunting prospect for beginners who are just getting started out with learning Docker. And this is where Docker Desktop comes in.
Developed by Docker, Docker Desktop is a free and user-friendly GUI application that allows users to easily run and manage Docker containers and images from their Linux PC without the need for executing commands on the CLI.
Docker Desktop is a cross-platform application which means you can install it on Windows, Linux, and Mac. It is free for companies of up to 250 employees beyond which you need a paid subscription.
Before installing anything else, ensure that your PC meets the following set of basic requirements.
- 64-bit CPU with Virtualization Support enabled.
- At least 4GB RAM
- A GUI desktop environment (Preferably GNOME, MATE, or KDE )
- A Sudo User with admin rights
Now let us jump right in and install Docker Desktop on Ubuntu 22.04
Step 1) Confirm KVM virtualization is enabled
To get off the ground, you need to ensure that KVM virtualization is supported. To check if the KVM module is loaded, run the command:
$ lsmod | grep kvm
If the module is loaded, you should get the following output. This shows that the KVM module for the Intel CPU is enabled.
If the module is not loaded, you can run the following commands:
For Intel Processors
$ sudo modprobe kvm_intel
For AMD Processors
$ sudo modprobe kvm_amd
Step 2) Install Docker on Ubuntu 22.04
The next step is to install Docker. But first, update the package lists and install the requisite dependencies as follows
$ sudo apt update $ sudo apt install software-properties-common curl apt-transport-https ca-certificates -y
Once the installation is complete, add Docker’s GPG signing key.
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/docker-archive-keyring.gpg
Next, add the official Docker’s repository to your system as follows.
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
Once the repository is in place, install Docker and other Docker tools as shown.
$ sudo apt install docker-ce docker-ce-cli containerd.io uidmap -y
After successful installation, add the user account to the Docker group using the following commands:
$ sudo usermod -aG docker $USER $ newgrp docker
To verify that docker is running, execute the following command:
$ sudo systemctl status docker
You can also check the version of Docker installed alongside other information as shown.
$ docker version
Step 3) Install Docker Desktop on Ubuntu 22.04
Docker Desktop is not yet available on official Ubuntu repositories or Docker itself. Therefore, you need to manually download the Debian binary file. from the Official Docker website.
At the time of writing this guide, the latest version of Docker Desktop is Docker Desktop version 4.15.0. You can use the wget command as shown.
$ wget https://desktop.docker.com/linux/main/amd64/docker-desktop-4.15.0-amd64.deb
Alternatively, you can click the following link under the ‘Linux DEB’.
Once the file is downloaded, install Docker Desktop by running the following apt command:
$ sudo apt install ./docker-desktop-*-amd64.deb
Step 4) Launch Docker Desktop
Once Docker Desktop is installed, you can use the application manager to search and launch it as shown.
You can also launch on the command line as shown.
$ sudo systemctl --user start docker-desktop
Once Docker Desktop is launched, the following pop-up will be displayed. Click ‘Accept’ to accept the license terms.
Shortly after, the Docker Desktop GUI dashboard will launch. It takes roughly 3 -5 minutes to initialize and get started so, be patient.
To take a tour of the Docker desktop and get tips on how to get started with Docker, hit the ‘Start’ button.
If you don’t wish to take the tour, simply click ‘skip tutorial’.
Finally, you will land on the Docker Desktop home page as you can see below with instructions on how to get started with containers.
Step 5) Configure Docker Desktop
Docker Desktop is highly configurable, and you can tweak almost every setting to suit your preferences.
These settings are grouped into the following:
- Docker Engine
- Experimental Features
- Software Updates
To access these settings, click on the top gear icon and the ‘Settings’ tab will appear with the above-mentioned options.
For example, in the resource tab, you can configure system resources required by Docker Desktop such as No, of CPUs, RAM, Swap space, etc.
Step 6) Running containers with Docker Desktop
When you have configured Docker Desktop according to your preferences, you can start running containers. As an example, we will run a Redis container.
So, click on ‘Run’
On the pop-up that appears, select the directory in which the container image will be pulled.
Docker Desktop will start pulling the container image from the Docker hub and create a container instance of Redis which is an in-memory key-value data store.
Once the image is pulled, a container will be created, and the following overview dashboard will be displayed.
You can click on the ‘Containers’ tab to view and manage all the containers on the system (whether running or stopped).
Similarly, you can click on the ‘Images’ tab to view and manage pulled container images.
Step 6) Uninstalling Docker Desktop
If you no longer need Docker Desktop on your system, you can uninstall it using the following command.
$ sudo apt purge docker-desktop
The remove the associated Docker Desktop files.
$ rm -r $HOME/.docker/desktop $ sudo rm /usr/local/bin/com.docker.cli
In this guide, we walked you through the installation of Docker Desktop and demonstrated the basics of how you can get started and start creating and managing container images. Your feedback on this guide will be appreciated.
Also Read: 20 Useful Docker Command Examples in Linux