This tutorial will guide you to install docker on a ubuntu server.
-
Update the server
sudo apt-get update -y
-
Install https respository packages.
sudo apt-get install -y --no-install-recommends \ apt-transport-https \ ca-certificates \ curl \ software-properties-common
-
Add GPG key
curl -fsSL https://apt.dockerproject.org/gpg | sudo apt-key add -
-
Verify key id
apt-key fingerprint 58118E89F3A912897C070ADBF76221572C52609D
-
Add docker repository.
sudo add-apt-repository \ "deb https://apt.dockerproject.org/repo/ \ ubuntu-$(lsb_release -cs) \ main"
-
Update and install docker
sudo apt-get update sudo apt-get -y install docker-engine
-
Check the docker service status
sudo service docker status
-
Finally, add your user to docker group and restart the terminal. So that you can use docker commands without
sudo
sudo usermod -aG docker <user-name>