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

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.