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/

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.