Cloud Service >> Knowledgebase >> General >> How to Install Docker Desktop on Ubuntu?
submit query

Cut Hosting Costs! Submit Query Today!

How to Install Docker Desktop on Ubuntu?

Docker is a tool that allows developers to deploy applications in small, portable containers automatically. Utilizing Docker Desktop on Ubuntu can optimize the development procedure. It will enable you to run and manage containers effortlessly. 

 

Prerequisites

 

Before you install Docker Desktop on Ubuntu, ensure:

 

  1. Ubuntu Version

Docker Desktop requires Ubuntu 20.04 or later.

 

  1. System Requirements

A minimum of 4 gigabytes of RAM and a 64-bit OS

 

  1. User Privileges

Make sure you have sudo rights to install and control packages.

 

Step-by-Step Installation Guide

 

Step 1: System Updation

 

Update your system before installing any new software. This confirms that all existing packages are up to date. 

Launch a terminal window and execute the provided commands:

 

sudo apt update

sudo apt upgrade -y

 

Step 2: Install Dependencies

 

Docker requires several dependencies to be installed. 

You can set them up with this command:

 

sudo apt install apt-transport-https ca-certificates curl software-properties-common -y

 

Step 3: Add Docker’s Official GPG Key

 

Next, add Docker’s official GPG key to your system. Verify the authenticity of the packages:

 

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

 

Step 4: Set Up the Docker Repository

 

Add Docker’s official repository to your system’s package source list:

 

echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

 

Step 5: Install Docker Engine

 

Update your package list again to include the Docker packages from the newly added repository:

 

sudo apt update

 

Then, install Docker Engine and Docker CLI:

 

sudo apt install docker-ce docker-ce-cli containerd.io -y

 

Step 6: Verify Docker Installation

 

To ensure Docker is installed correctly, check the version:

docker --version

 

You should see output similar to Docker version XX.XX.X, build XXXXX.

 

Step 7: Install Docker Desktop

 

Docker Desktop cannot be found in the Ubuntu repository and needs to be acquired by downloading it from Docker's official website. First, assure you have the necessary dependencies:

 

sudo apt install gnome-terminal

 

Obtain the Docker Desktop .deb package from the official site,

or

use the command below to download the newest version.

 

wget https://desktop.docker.com/linux/main/amd64/docker-desktop--.deb

 

Step 8: Install Docker Desktop

 

Once the download is complete, install Docker Desktop using the following command:

 

sudo dpkg -i docker-desktop--.deb

 

If there are any dependency errors, you can fix them by running:

 

sudo apt --fix-broken install

 

Step 9: Start Docker Desktop

 

After installation, you can start Docker Desktop from the application menu or by running the following command:

 

systemctl --user start docker-desktop

 

Step 10: Enable Docker Desktop to Start on Boot

 

To ensure Docker Desktop starts automatically when your system boots up, run the following command:

 

systemctl --user enable docker-desktop

 

Post-Installation Steps

 

Verify Docker Desktop Installation

 

You can verify that Docker Desktop is running by checking the status:

systemctl --user status docker-desktop

 

Manage Docker as a Non-Root User

 

Include your user in the docker group to prevent the need for sudo when using Docker commands.

 

sudo usermod -aG docker $USER

 

To see the changes, sign out and log in again.

 

Troubleshooting Common Issues and Fixes

 

  • Dependency Issues

 

If you encounter dependency issues during installation, running sudo apt --fix-broken install can resolve most problems.

 

  • Permission Denied

 

To avoid a "permission denied" error while running Docker commands, make sure your user is included in the Docker group and restart your session.

 

  • Docker Desktop Fails to Start

 

Check the status using systemctl --user status docker-desktop and look for error messages. Reinstalling Docker Desktop may help resolve persistent issues.

 

To Sum it Up!

 

Installing Docker Desktop on Ubuntu is straightforward. It can significantly enhance your development workflow by providing a robust platform for containerized applications. Following this guide, you can ensure a smooth installation and leverage Docker’s powerful features for your projects. Whether developing locally or deploying to the cloud, Docker Desktop on Ubuntu offers a versatile and efficient environment for all your container needs.

Cut Hosting Costs! Submit Query Today!

Grow With Us

Let’s talk about the future, and make it happen!