Get the dependencies
curl -fsSL https://get.docker.com -o get-docker.sh
Execute the script
sudo sh ./get-docker.sh
Manage Docker as a non-root user
sudo groupadd docker || true
sudo usermod -aG docker "$USER" || true
newgrp docker
NOTICE
Restart the VM if the following error occurs. Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/json: dial unix /var/run/docker.sock: connect: permission denied
restart vm