'docker: Cannot connect to the Docker daemon at tcp://0.0.0.0:1000. Is the docker daemon running?

I don't know who kill my docker daemon. After that, my docker stopped and I try to use some commands like
service docker start,
systemctl restart docker,
systemctl daemon-reload is not useful.

So I uninstall docker and remove all docker env files. Then I reinstall docker, but when I use docker ps, the screen prints the error Cannot connect to the Docker daemon at tcp://0.0.0.0:1000. Is the docker daemon running?

If use sudo docker ps, it works. So I try to add my account to sudo group then use docker ps, but get the same error.

My previous config file set the tcp for pycharm. But my new config file is the default.

Although I can add sudo to use docker, I still want to figure it out.

Thanks for your help!



Solution 1:[1]

This is a security feature. The socket is owned by root. If there is a usergroup docker it is owned by this. So add your user to this group:

 sudo groupadd docker
 sudo usermod -aG docker $USER

Logout and -in after that.

This group grants root-like rights, so be sure whom you trust..

Check also env | grep DOCKER_HOST, should be no value. If there is a value do unset DOCKER_HOST.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 araisch