Problem: You are trying to run a docker container or do the docker tutorial, but you only get an error message like this:
docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.26/containers/create: dial unix /var/run/docker.sock: connect: permission denied. See 'docker run --help'. Solution: The error message tells you that your current user can’t access the docker engine, because you’re lacking permissions to access the unix socket to communicate with the engine.
As a temporary solution, you can use sudo to run the failed command as root. However it is recommended to fix the issue by adding the current user to the docker group: