Docker Community Forums

Share and learn in the Docker community.

Couldn't connect to Docker daemon at http+docker://localhost - is it running?

ERROR: Couldn’t connect to Docker daemon at http+docker://localhost - is it running?

If it’s at a non-standard location, specify the URL with the DOCKER_HOST environment variable.

I am getting the above error on Ubuntu 18 machine when running docker compose on jenkins workspace /var/lib/jenkins/workspace

docker-compose version 1.25.1, build a82fef07
Docker version 19.03.5, build 633a0ea838
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.3 LTS
Release:        18.04
Codename:       bionic
systemctl status docker.service

Jan 16 06:57:53 Wdsys dockerd[19160]: time="2020-01-16T06:57:53.569004581Z" level=error msg="Handler for POST /v1.30/build returned error: invalid reference format"
1 Like


  1. Add user to docker group (if not already added)
    sudo usermod -aG docker $USER
    2. create a symbolic link to /usr/bin using the following command
    $ sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
    3. Restart docker service
    $ sudo service docker restart

I had the same issue.
sudo service docker restart worked for me.

Thanks @riadhoq


I had to run sudo docker-compose up. Apparently docker was running as root because of sudo systemctl start docker and my user couldn’t access it.


Yeah, adding the sudo in front, helped me. Thanks


as mentioned above sudo docker-compose up fixed the problem for me.

Add sudo before CLI worked for me