In this tutorial post we are going to show the method to install docker on ubuntu operating system.
Requirements to install docker on ubuntu operating system:
64-bit Ubuntu 16.04 server.
Kernel version equal or greater than 3.10
Make sure that you have sudo privilege.
Note: Docker requires a 64-bit version of Ubuntu as well as a kernel version equal to or greater than 3.10. The default 64-bit Ubuntu 16.04 server meets these requirements.
Install Docker on Ubuntu
At first get the latest version of docker from the official docker repository. Though docker installation package in available in Ubuntu, it might not be the latest version so make sure you have latest version of docker. Now add the GPG key for the official Docker repository to your system with the command below:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Now add the Docker repository to APT sources:
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
Now update your packages:
sudo apt-get update
Now make sure that you are going to install docker from the official Docker repo not from the default Ubuntu repo:
apt-cache policy docker-ce
sudo apt-get install -y docker-ce
To check whether docker is running or not, type the following command:
sudo systemctl status docker