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
For installation confirmation enter the Y key to proceed.
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
Step 5 : Verify the docker version.
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
Step 3 : Add software authentication GPG Key.
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –
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
Step 5 : Check versions of Docker
apt-cache madison docker-ce
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
Step 6 : Verify docker version
Using .deb package :
Step 1 : Click on the following button to download the .deb packages
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
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.
This web site truly has all the info I wanted concerning this subject and didn’t know
who to ask.