What is Docker?
“Docker is used to run software packages called “containers”. Containers are isolated from each other and bundle their own application, tools, libraries and configuration files; they can communicate with each other through well-defined channels. All containers are run by a single operating system kernel and are thus more lightweight than virtual machines. Containers are created from “images” that specify their precise contents. Images are often created by combining and modifying standard images downloaded from public repositories.” –Wikipedia
Below is a quick introductory video about Docker
sudo apt update
sudo apt upgrade
Install packages which let apt use packages over https
sudo apt install apt-transport-https ca-certificates curl software-properties-common
Add GPG key for official docker repository
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –
Add the Docker repository to apt
sudo add-apt-repository “deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable”
Update package lists, etc.
sudo apt update
apt-cache policy docker-ce
sudo apt install docker-ce
Check if Docker service is running
sudo systemctl status docker
hit “q” to exit.
If docker service is not running, start it on boot by using the following command
sudo systemctl enable docker
Again check docker’s service status. And see if docker service is running.
Now, Docker is successfully installed. But by default, docker needs root privileges to run. i.e. we need to use sudo for executing every docker command. To avoid this, add your username to docker group.
sudo usermod -aG docker <username>
To apply for the new group membership, log out and log back into the system.
Confirm if your user is added to the group
I hope this tutorial has helped you install Docker in Ubuntu 18.04. If you have any doubts, find any grammatical errors, or want to request any tutorial, feel free to make use of comments section. Thanks for reading!