Getting an error while running docker

I run docker version command and getting the error permission denied at the end of the result. When I’m running any other docker command it’s giving me the same error. Attched the screensshot for your refrence.

Docker consists of 2 parts:

  1. The client, which you’re executing on the command line
  2. The daemon, which is responsible for actually running the containers

When you start containers, list all images, list all runnin containers, etc.; the client connects to the daemon to obtain that information, or to ask the daemon to execute some action. Without a running Docker daemon, you can’t do anything Docker-related on your system.

So, the error might be one of two things.

  1. The docker server can’t be reached. But usually, docker will tell you “Is the docker daemon running?”
  2. There’s some issue with establishing a connection. Which seems more likely because of the permission denied message.

It will work with sudo docker version
the problem is docker user has to be given permision
check out post-installation steps.