Cannot connect to the Docker daemon at unix:///var/run/docker.sock Is the docker daemon running?

after I logged into dockerhub I got this error message. Actually this command worked well before.

here is my error :
harivinu01@penguin:~$ docker images
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

harivinu01@penguin:~$ sudo dockerd
INFO[2022-10-11T13:22:34.184862991+05:30] Starting up
failed to start daemon: pid file found, ensure docker is not running or delete /var/run/docker.pid

I moved the topic from the Community category to DockerEngine. See the description of the previous category:

Please, donā€™t use a topic name like ā€œHow to fix this issue?ā€. Every issue is to be fixed and it canā€™t be searched for.
I renamed it and I immediately got multiple warnings because

If you use proper topic names you can find an answer even without opeing a new topic. In this case those topics were not answered but it is a common issue so searching on the forum or on Google would give you many results.

Your first command runs without sudo. If your user is not in the ā€œdockerā€ group, it will probably not have right to use docker commands. Your second command used sudo to start the daemon again, which was already running. If docker images worked before, your system must have changed somehow.

Try sudo docker images to confirm the theory.

@hariprabhu21 Have you solved this problem?
I have the same problem.

Me too im having the same issue.

Have you read the end of my previous post?

Maybe I shouldnā€™t have posted it at the end of a moderator note.

1 Like

Iā€™m still having issues with this, with the sudo option.

sudo docker ps

Password:

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

MernyPierreMBP:~ merny24$

Is it? :slight_smile: How did you check? how did you install Docker?

I installed it using the installer link from the official docker website. My mac is a M2 so i pick the Apple version of the application. I can see docker running under activity but for some reasons its not allowing to to trigger the deamon.

sudo: start: command not found

MernyPierreMBP:~ merny24$ sudo systemctl start dockerd

sudo: systemctl: command not found

MernyPierreMBP:~ merny24$ systemctl start dockerd

-bash: systemctl: command not found

MernyPierreMBP:~ merny24$ sudo dockerd

sudo: dockerd: command not found

MernyPierreMBP:~ merny24$

I ran the above command is there a recommended command to run?

This topic is about the Docker Engine running on Linux. You are using Docker Desktop on macOS where there is no systemd and Docker runs inside a virtual machine.

And what about the GUI? How did you start Docker Desktop? .

Note: I found your topic. Letā€™s continue your issue there.