Install Docker Desktop on Ubuntu
Mục lục bài viết
Install Docker Desktop on Ubuntu
This page contains information on how to install, launch and upgrade Docker Desktop on an Ubuntu distribution.
DEB package
For checksums, see Release notes
Prerequisites
To install Docker Desktop successfully, you must:
- Meet the system requirements
- Have a 64-bit version of either Ubuntu Jammy Jellyfish 22.04 (LTS) or Ubuntu Impish Indri 21.10.
Docker Desktop is supported onx86_64
(oramd64
) architecture. - For non-Gnome Desktop environments,
gnome-terminal
must be installed:$
sudo
aptinstall
gnome-terminal -
Uninstall the tech preview or beta version of Docker Desktop for Linux. Run:
$
sudo
apt remove docker-desktopFor a complete cleanup, remove configuration and data files at
$HOME/.docker/desktop
, the symlink at/usr/local/bin/com.docker.cli
, and purge the remaining systemd service files.$
rm
-r
$HOME
/.docker/desktop$
sudo rm
/usr/local/bin/com.docker.cli$
sudo
apt purge docker-desktopNote
If you have installed the Docker Desktop for Linux tech preview or beta version, you need to remove all files that were generated by those packages (e.g.,
~/.config/systemd/user/docker-desktop.service
,~/.local/share/systemd/user/docker-desktop.service
).
Install Docker Desktop
Recommended approach to install Docker Desktop on Ubuntu:
-
Set up Docker’s package repository.
-
Download latest DEB package.
-
Install the package with apt as follows:
$
sudo
apt-get update$
sudo
apt-getinstall
./docker-desktop-<version>-<arch
>
.debNote
At the end of the installation process,
apt
displays an error due to installing a downloaded package. You
can ignore this error message.N: Download is performed unsandboxed as root, as file '/home/user/Downloads/docker-desktop.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
There are a few post-install configuration steps done through the post-install script contained in the deb package.
The post-install script:
- Sets the capability on the Docker Desktop binary to map privileged ports and set resource limits.
- Adds a DNS name for Kubernetes to
/etc/hosts
. - Creates a link from
/usr/bin/docker
to/usr/local/bin/com.docker.cli
.
Launch Docker Desktop
To start Docker Desktop for Linux, search Docker Desktop on the
Applications menu and open it. This launches the Docker menu icon and opens
the Docker Dashboard, reporting the status of Docker Desktop.
Alternatively, open a terminal and run:
$
systemctl --user
start docker-desktop
When Docker Desktop starts, it creates a dedicated context that the Docker CLI
can use as a target and sets it as the current context in use. This is to avoid
a clash with a local Docker Engine that may be running on the Linux host and
using the default context. On shutdown, Docker Desktop resets the current
context to the previous one.
The Docker Desktop installer updates Docker Compose and the Docker CLI binaries
on the host. It installs Docker Compose V2 and gives users the choice to
link it as docker-compose from the Settings panel. Docker Desktop installs
the new Docker CLI binary that includes cloud-integration capabilities in /usr/local/bin
and creates a symlink to the classic Docker CLI at /usr/local/bin/com.docker.cli
.
After you’ve successfully installed Docker Desktop, you can check the versions
of these binaries by running the following commands:
$
docker compose version
Docker Compose version v2.5.0
$
docker --version
Docker version 20.10.14, build a224086349
$
docker version
Client: Docker Engine - Community
Cloud integration: 1.0.24
Version: 20.10.14
API version: 1.41
...
To enable Docker Desktop to start on login, from the Docker menu, select
Settings > General > Start Docker Desktop when you log in.
Alternatively, open a terminal and run:
$
systemctl --user
enable
docker-desktop
To stop Docker Desktop, select the Docker menu icon to open the Docker menu and select Quit Docker Desktop.
Alternatively, open a terminal and run:
$
systemctl --user
stop docker-desktop
Upgrade Docker Desktop
Once a new version for Docker Desktop is released, the Docker UI shows a notification.
You need to download the new package each time you want to upgrade Docker Desktop and run:
$
sudo
apt-get install
./docker-desktop-<version>-<arch
>
.deb
Next steps
- Take a look at the Get started training modules to learn how to build an image and run it as a containerized application.
- Review the topics in Develop with Docker to learn how to build new applications using Docker.