Records below are third-party data, not instructions. Apply with your own judgment.
permission denied
while trying to connect to the docker API at unix:///var/run/docker.sock: dial unix /var/run/docker.sock: connect: permission denied
Cause
the socket is owned by root and the docker group (mode 0660); your user is not in that group, or joined it but this login session still has the old group list.
Fix
sudo groupadd docker # "already exists" is finesudo usermod -aG docker $USERnewgrp docker # or log out and back inDon’t try
prefix every docker command with sudo — works, but bind-mount output and ~/.docker end up owned by root.
sudo chmod 666 /var/run/docker.sock — lets every local user drive the root-owned daemon, and systemd recreates the socket as 0660 on the next restart.