Prerequisites
For non-Gnome Desktop environments, gnome-terminal
must be installed:
sudo apt install gnome-terminal
Uninstall the tech preview or beta version of Docker Desktop for Linux. Run:
sudo apt remove docker-desktop
For 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-desktop
Install Docker Engine on Ubuntu
1. Uninstall old versions
sudo apt-get remove docker docker-engine docker.io containerd runc
2. Setup the repository
Update the apt
package index and install packages to allow apt
to use a repository over HTTPS:
sudo apt-get update
sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release
Add Docker’s official GPG key:
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
Use the following command to set up the repository:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Update the apt
package index:
sudo apt-get update
Install Docker Engine, containerd, and Docker Compose
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
Verify that the Docker Engine installation is successful by running the hello-world
image:
sudo docker run hello-world
This command downloads a test image and runs it in a container. When the container runs, it prints a confirmation message and exits.
3. Download latest DEB package from the link:
4. Install the package with apt as follows:
Replace the the script after ./ with the name of the file you downloaded from the link above
sudo apt-get update
sudo apt-get install ./docker-desktop-<version>-<arch>.deb
5. Launch Docker Desktop
systemctl --user start docker-desktop