Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Enable TCP port 2375 for external connection to Docker

Enable TCP port 2375 for external connection to Docker

See this issue.
Docker best practise to Control and configure Docker with systemd.

  1. Create daemon.json file in /etc/docker:

     {"hosts": ["tcp://", "unix:///var/run/docker.sock"]}
  2. Add /etc/systemd/system/docker.service.d/override.conf

  3. Reload the systemd daemon:

     systemctl daemon-reload
  4. Restart docker:

     systemctl restart docker.service
Copy link

valterm commented Dec 9, 2021

Can confirm it works both on arch and debian 11.

Copy link

rfay commented Dec 27, 2021

I was also unable to get it to work on Debian 11 without the workaround in (directly editing the docker.service file). It seems that on Debian 11, the docker.service.d/override.conf doesn't actually get read, so you just have to edit the docker.service.

I also used ExecStart=/usr/sbin/dockerd --containerd=/run/containerd/containerd.sock --tls=false to avoid the very strong and important complaints:

Binding to IP address without --tlsverify is insecure and gives root access on this machine to everyone who has access to your network. host="tcp://".
Binding to an IP address, even on localhost, can also give access to scripts run in a browser. Be safe out there! host="tcp://"
Binding to an IP address without --tlsverify is deprecated. Startup is intentionally being slowed down to show this message host="tcp://"
Please consider generating tls certificates with client validation to prevent exposing unauthenticated root access to your network host="tcp://"
You can override this by explicitly specifying '--tls=false' or '--tlsverify=false' host="tcp://"
Support for listening on TCP without authentication or explicit intent to run without authentication will be removed in the next release host="tcp://"

Copy link

boris779 commented Jan 24, 2022

I absolutely do not get this run with docker 20.10.12 and ubuntu 21.10

I tried to edit /usr/lib/systemd/system/docker.service or do it via systemctl edit docker.service
Every time when I add -H tcp:// or tcp:// the docker.service cannot start
I tried with -H unix, without, with --containerd and without.

ExecStart=/usr/bin/dockerd -H tcp:// -H unix:///var/run/docker.sock --containerd=/run/containerd/containerd.sock

Any suggestion how to solve it?

Copy link

vincentgerris commented Jan 24, 2022

check logs, journalctl -xe. The options overlap, remove the , means all interfaces.

Copy link

h4r5h1t-hrs commented Jan 28, 2022

Follow this:

NOTE: Just change the IP from to and its work fine for Ubuntu ( for selenium dynamic grid)

Copy link

smblott-github commented Feb 1, 2022

I found that the docker daemon failed to start on reboot (only) with the approach described here. I never tracked down the source of the problem.

However, it did lead me to implement instead an alternative solution with socat:

exec socat -d TCP-LISTEN:2375,fork UNIX-CONNECT:/var/run/docker.sock


  • I used daemontools to launch this an keep it running (
  • You can protect the port with the range=... option to socat, or with IP tables or netfilter.

Copy link

Nakilon commented Apr 20, 2022

Does not work for Docker Desktop on Windows. It refuses bind to

Copy link

rcedillo45 commented Apr 27, 2022

I was having an issue to connect from another machine, turns out it was a firewall issue.
to fix I did:
ufw allow 2375/tcp
ufw reload
hopefully this helps someone.

Copy link

russellhoff commented May 12, 2022


Copy link

sithson commented May 19, 2022

👍 ✔️ 🙇‍♀️
I can also confirm this, very much GG @styblope, my rock star hero!1 :))))))


  • Linux Mint 20.3 Una x64
  • Docker version 20.10.16, build aa7e414
  • Docker Compose version v2.5.0

Copy link

sumitdhungana14 commented Aug 4, 2022


Copy link

AbdelazizSharaf001 commented Sep 1, 2022

I need to run docker from external docker client but the docker server is containerized (no daemon)
is it aplicable ?

Copy link

russellhoff commented Sep 9, 2022

I need to run docker from external docker client but the docker server is containerized (no daemon) is it aplicable ?

AFAIK, Docker will be run as daemon wherever you deploy it.

Copy link

webzakimbo commented Sep 28, 2022

Here's another way that worked for me:


 ExecStart=/usr/bin/dockerd --config-file /etc/docker/daemon.json


  "hosts": ["tcp://", "unix:///var/run/docker.sock"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment