Error on executing command (linux) : $ docker ps -a

After installing Docker on Ubuntu Ubuntu 18.04.3 LTS with curl -sSL https://get.docker.com/ | sh

  • I started docker :systemctl start docker
  • sudo docker run hello-world
  • finally listed containers : $ docker ps -a

RESULT : An error occurred trying to connect: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/json?all=1: EOF

Source: StackOverflow