PortGate

Resources · Port reference · port 2375

Port 2375 (Docker API): what it is and how to secure it

Port 2375 is the Docker daemon with no encryption and no login. Anyone who can reach it is root on the server.

Check command

sudo ss -tlnp | grep -E "2375|2376"

Copied.

Port 2375 is the Docker Engine API without TLS or authentication. If it is reachable, anyone can take full control of the server. Close it now; there is no safe way to leave it public.

What port 2375 is for

Docker normally listens on a Unix socket, /var/run/docker.sock, which only root and the docker group can use. Docker can also listen on TCP so remote tools can manage it. Port 2375 is the plain, unencrypted TCP listener. Port 2376 is the TLS version.

Why an open 2375 is game over

The Docker API can start any container with any options. An attacker can run:

docker -H tcp://YOUR_SERVER_IP:2375 run --rm -it --privileged -v /:/host alpine chroot /host

That gives them a root shell on your server, not just in a container. Automated campaigns scan for 2375 and use exactly this to install cryptominers and backdoors.

Check yours

sudo ss -tlnp | grep -E "2375|2376"
grep -rs "tcp://" /etc/docker/daemon.json /etc/systemd/system/docker.service.d/ /lib/systemd/system/docker.service

From another machine:

curl -s http://YOUR_SERVER_IP:2375/version

Any JSON reply means the Docker API is public.

Fix it

Remove the TCP host. It is set in one of two places.

In /etc/docker/daemon.json, delete the tcp:// entry so only the socket remains:

{
  "hosts": ["unix:///var/run/docker.sock"]
}

In a systemd override such as /etc/systemd/system/docker.service.d/override.conf, remove -H tcp://0.0.0.0:2375 from ExecStart. Then reload and restart:

sudo systemctl daemon-reload
sudo systemctl restart docker
sudo ss -tlnp | grep 2375

The last command should print nothing.

If it was already exposed

Assume the host is compromised. Check for containers, images and jobs you did not create:

docker ps -a
docker images
sudo ls -la /etc/cron.d /var/spool/cron/crontabs
sudo cat /root/.ssh/authorized_keys

Rebuilding the server from a clean image is the safest answer.

If you need remote Docker access

Use SSH instead of TCP. Docker supports it directly:

docker context create prod --docker "host=ssh://you@YOUR_SERVER_IP"
docker --context prod ps

If you truly need TCP, use 2376 with tlsverify and client certificates, and allow only your own IP.

Common mistakes

  • Copying a CI or Portainer guide that adds -H tcp://0.0.0.0:2375. Many older guides do.
  • Thinking a firewall rule is enough. One mistake in the rules, or a provider firewall reset, and the server is open.
  • Mounting the socket into a public web container. /var/run/docker.sock inside a container gives that container the same power.

FAQ

Is 2376 safe? Only with tlsverify and client certificates. TLS without client verification is still open to anyone.

Does Docker Desktop open 2375? Only if "Expose daemon on tcp://localhost:2375" is ticked, and then only on localhost. Leave it off.

How do I catch this in future? PortGate's Server Guard alerts on a public 2375 or 2376 and on containers that mount the Docker socket.