Before you begin, ensure that your system meets the following requirements:
Docker Engine is installed from Docker's official repository. The first step is to set up this repository.
Open a terminal and run the following commands to add Docker's GPG key, which is necessary for verifying the integrity of the Docker packages:
sudo apt-get update
sudo apt-get install -y ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
Next, add Docker's repository to your system's apt sources list:
echo
'deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu
$(. /etc/os-release && echo '
$VERSION_CODENAME') stable' | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
This command configures your package manager to download Docker packages from Docker's official repository.
VERSION_CODENAME
with UBUNTU_CODENAME
in the command above.After adding the repository, update the package index to include Docker's packages:
sudo apt-get update
Now that the repository is set up, you can install Docker Engine and its associated components.
Run the following command to install Docker Engine, Docker CLI, containerd, and the Docker Compose plugin:
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
To verify that Docker Engine has been installed correctly, run the following command:
sudo docker run hello-world
This command downloads a test Docker image (hello-world
) and runs it in a container. If Docker is installed correctly, you will see a message that displays 'Hello form Docker'.
If you haven't already, set up Docker's apt repository by following the steps in Step 1 above.
Download the latest version of the Docker Desktop package from Docker's official website download here and use the following command :
sudo apt-get update
sudo apt-get install ./path/to/docker-desktop-.deb
` with your system's architecture (e.g.,
amd64`). systemctl --user start docker-desktop
This command will install Docker Desktop, allowing you to manage Docker through a user-friendly graphical interface.