What are "cannot connect to the Docker daemon" errors in GitLab CI/CD pipelines and how do I fix them?

Modified on Wed, 29 Mar 2023 at 02:14 PM

GitLab CI/CD pipelines may encounter "Cannot connect to the Docker daemon" errors for a number of causes, including improper Docker configuration, erroneous permissions, or network problems.


Make sure the GitLab Runner-installed machine can reach the port if the Docker daemon is listening on a TCP port. Look into any firewall settings or network problems that might be interfering with the GitLab Runner's ability to establish a TCP connection with the Docker daemon.


The following command can be used to see if the Docker daemon is waiting on a TCP port:

sudo netstat -tlnp | grep docker

If the Docker daemon is not listening on a TCP port, check the Docker daemon configuration file to ensure that the hosts parameter is set correctly.


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article