here is the error message that you 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.24/images/load?quiet=0": dial unix /var/run/docker.sock: connect: permission denied
The error message you’re seeing indicates that your current user does not have the necessary permissions to connect to the Docker daemon.
1. Add Your User to the Docker Group
- Add your user to the Docker group:
sudo usermod -aG docker $USER
- Log out and log back in to apply the group changes, or run the following command to refresh your group membership
newgrp docker
- Verify you can run Docker commands without sudo:
docker ps
Now check if this fix your problem, it should.
if not then try next topic.
2. Check Docker Daemon Status
Make sure the Docker daemon is running. You can start it with the following command:
sudo systemctl start docker
To check its status:
sudo systemctl status docker
!!! At this point it’s should work now !!!
Below is a further troubleshooting.
Reinstall Docker
If you still encounter issues, ensure Docker is installed correctly. You can reinstall Docker if necessary:
sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get install docker.io
Check File Permissions
Ensure that the permissions of the /var/run/docker.sock
socket file are correct:
ls -l /var/run/docker.sock
You should see something like this:
srw-rw---- 1 root docker 0 date /var/run/docker.sock
If the group is not docker
, you can change it:
sudo chown root:docker /var/run/docker.sock
sudo chmod 660 /var/run/docker.sock
Adding your user to the docker
group should stop your issue.