I installed Docker in my machine where I have Ubuntu OS. After than I installed docker, when I run
sudo docker run hello-world
All it\'s ok
You can always try Manage Docker as a non-root user paragraph in the https://docs.docker.com/install/linux/linux-postinstall/ docs.
Manage Docker as a non-root user
After doing this also if the problem persists then you can run the following command to solve it:
sudo chmod 666 /var/run/docker.sock