https://docs.docker.com/compose/install/
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
First, we must create the docker group:
sudo groupadd docker
Then, add your current user to the docker group:
sudo gpasswd -a ${USER} docker
Now you can restart the Docker daemon:
sudo service docker restart
Now you should be able to run it without sudo:
docker run hello-world
If you have any problem, try logging out/in or rebooting your machine.