permission denied while trying to connect to the Docker daemon socket

Your Linux user isn't in the `docker` group, so it can't access the daemon's socket without `sudo`.

Common causes

  • User was never added to the docker group
  • Group membership changed but the session wasn't restarted

Diagnostic commands

bash
$ groups $USER

Solutions

  • Add your user to the group: `sudo usermod -aG docker $USER`
  • Log out and back in (or run `newgrp docker`) for it to take effect

Related tutorials