How to fix – Cannot connect to the Docker daemon

Question: I’m getting this error message when attempting to connect to the Docker daemon ? Can you supply a method to fix this issue



docker info
Cannot connect to the Docker daemon at 
tcp://localhost:2375/usr/lib/systemd/system/docker.socket. Is the docker daemon running?

Answer: I‘ve experienced this problem previously – and this is the way I worked around the problem.Let me know if this doesn’t fix the issue

  1. Add your self to the docker group

    usermod -aG docker $USER

  2. Fix permissions on docker socker and command.

    sudo chgrp docker /usr/bin/docker
    sudo chgrp docker /var/run/docker.sock

    $ ll $(which docker)
    -rwxr-xr-x 1 root docker 18991768 08.07.2017 22:57 /usr/bin/docker*

    $ ll /var/run/docker.sock
    srw-rw---- 1 root docker 0 23.07.2017 10:21 /var/run/docker.sock

  3. Add variables to config environment for docker command

    export DOCKER_HOST=unix:///var/run/docker.sock

  4. Rest Docker

    sudo systemctl restart docker

Author: Jack Vamvas

Leave a Reply

Discover more from ciquery

Subscribe now to keep reading and get access to the full archive.

Continue reading