Download / Install Docker ( Ubuntu )

Docker application makes easy to manage the application and run them into containers. It increases the application performance as it uses it’s own resources.

Docker can be installed on all operating systems.

Here, we will look how to install docker on Ubuntu.
We should have ubuntu installed either on real machine or any virtual machine.

Docker can be installed using default or official repositories or from a .deb package. We will see one by one different ways.

Using Ubuntu Default Repositories :

Ubuntu default repositories do have the docker version but we assure the latest version from here.

Step 1 : With apt-get command update the Ubuntu.

sudo apt-get update

Step 2 : This command checks if any docker version is already installed. If any old versions are available then this will remove it for fresh installation.

sudo apt-get remove docker docker-engine docker.io

Step 3 : Install the Docker

sudo apt install docker.io
Install Docker Ubuntu
Install Docker Ubuntu

For installation confirmation enter the Y key to proceed.

Docker Installed
Docker Installed

symlink for docker.socket will be created once the docker is successfully installed.

Step 4 : Verify and enable the docker service.

sudo systemctl start docker
sudo systemctl enable docker
Start & Enable Docker Service
Start & Enable Docker Service

Step 5 : Verify the docker version.

docker --version
Check Docker Version
Check Docker Version

Using Official Repository :

Ubuntu Official repositories we get options to select the required version of docker.

Step 1 : Update local repositories with apt-get command.

sudo apt-get update

Step 2 : Access the docker repositories

Note : Running the command before verify if you have curl installed on Ubuntu : curl –version
Check the blog if curl is not installed – Download / Install Curl On Ubuntu

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

apt-transport-https : Helps to transfer data file and access over https
ca-certificates : Security certificates are accessed
curl : Used for transferring data.
software-properties-common : Used to manage software distribution

Access Docker Repositories
Access Docker Repositories

Step 3 : Add software authentication GPG Key.

sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –
Add GPG Key
Add GPG Key

Step 4 : Enter the command to install docker repository.

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

$(lsb_release -cs) provides the Ubuntu installation name

Install Docker Repository
Install Docker Repository

Step 5 : Check versions of Docker

apt-cache madison docker-ce
Check Versions Of Docker
Check Versions Of Docker

Step 5 : Install Docker

Example : Here we will use version “5.19.03.11-3-0~ubuntu-bionic”

sudo apt-get install docker-ce=5.19.03.11-3-0~ubuntu-bionic
Install Docker
Install Docker

Step 6 : Verify docker version

Check Docker Version
Check Docker Version

Using .deb package :

Step 1 : Click on the following button to download the .deb packages

Download Docker .deb

Step 2 : Download the required proper version and save it in particular folder or look in download folder.

Step 3 : Enter the command to run .deb installer.

sudo dpkg -i containerd.io_1.2.0-1_amd64.db
Run .deb Installer
Run .deb Installer


Check Similar Blogs :

Important docker commands
Download / Install Docker Toolbox ( Windows 7 & Above )
Download / Install Docker Toolbox ( macOS )
Download / Install Docker ( Ubuntu )
Download / Install Docker ( CentOS )

Hope this information was helpful to you.
Feel free to comment if you face any issues or have any doubts.

One comment

Leave Your Reply

Your email address will not be published. Required fields are marked *