Note:- To install docker on ubuntu 18.04, you need ubuntu 18.04 with 64-bit system.
Docker or docker-engine are the older versions of dockers. If any of these versions are installed in the system, let uninstall them first.
Note:- The docker community package (docker-ce) is now called as docker-ce. docker-ce means docker community edition.
Enter below command on your ubuntu terminal in order to uninstall any older version of docker.
$ sudo apt-get remove docker docker-engine docker.io
For updating the ubuntu package. Please run below command
$ sudo apt-get update
Run below command which is used to installing curl and allow apt to use a repository over https
$ sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
Now add the docker GPG key for the official docker repository in your system using the below command
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Verify added key to the system.
Please run below command in terminal for searching the last 8 characters of the fingerprint in order to verify that now we have key with the finger print 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88.
$ sudo apt-key fingerprint 0EBFCD88
Add into apt repository
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
first update the apt package
$ sudo apt-get update
To install the latest version of docker please run
$ sudo apt-get install docker-ce
It will install docker and will start the docker daemon automatically.
Now docker install is complete and we should have docker running on our system.
We have installed the docker in our system, now check what is the status of docker using the below command
$ sudo systemctl status docker
Check docker version and detailed info about docker using the below commands
$ sudo docker --version
$ sudo docker version
$ sudo docker info
As we have installed docker and it should start automatically but in some case we require to stop and start the docker. below are commands for this purpose.
Command for stopping the docker
$ sudo systemctl stop docker
Command for starting the docker
$ sudo systemctl start docker
First run the command on terminal
$ sudo apt-get purge docker-ce
Then run
$ sudo rm -rf /var/lib/docker
Which will delete all images, containers and volumes or configuration of the docker from the system.
All Rights Reserved. ReadAndCare