Port 2375 (Docker API, no TLS)

Port 2375 is the port of the Docker API when it is configured to accept network connections without encryption, which is why it is important never to open…

Key facts

Port
2375
Protocols
TCP
Range
Registered port, 1024-49151
IANA service name
docker

IANA assigns ports in this range to services on request, under RFC 6335.

About port 2375

Port 2375 is the port of the Docker API when it is configured to accept network connections without encryption, which is why it is important never to open it to the internet. In the IANA port registry, TCP port 2375 is registered for the docker service, described as Docker REST API (plain text).

By default, Docker accepts commands only through a local socket file, /var/run/docker.sock, and does not listen on the network at all. According to the Docker documentation, the conventional port for network access is 2376 when the connection is encrypted with TLS, and 2375 when it is not. The Docker documentation marks unauthenticated TCP connections as deprecated, and states that listening on any TCP address other than localhost will require TLS authentication.

What port 2375 is used for

  • Local access only: tools running on the same server, such as monitoring tools, sometimes connect to Docker at tcp://localhost:2375.
  • Closed test environments: in a lab or an isolated internal network, for short tests.

For managing Docker remotely, the Docker documentation offers two secure options: a connection over SSH, or a TLS-encrypted connection on port 2376.

Port 2375 in the firewall

Never open port 2375 to the internet. When Docker needs to listen on TCP, configure it to listen only on the local address, localhost, and block the port in the firewall:

  • UFW: ufw deny 2375/tcp
  • firewalld: firewall-cmd --permanent --remove-port=2375/tcp

For remote access, use an SSH connection to the server, for example with docker context create, and then you don't need to open any Docker port in the firewall.

Risks and security

The Docker documentation warns that exposing Docker to the network without security allows unauthorized access to the server, and that a remote user can gain root privileges on the server. Anyone who reaches port 2375 can run containers, read files and change settings, without a password. These settings protect the server:

  • Keep Docker at its default setting, with a local socket only.
  • For remote access, use SSH, or TLS with client certificates on port 2376.
  • Check from time to time that the /etc/docker/daemon.json file and the service settings don't contain the address tcp://0.0.0.0:2375.
  • Limit the docker group to users who really need it, because membership in it is effectively equivalent to root privileges.

Commands to check and configure

  • ss -tlnp | grep dockerd

    Shows whether Docker is listening on any TCP port, and on which address (requires root privileges). When there is no output, Docker listens only on the local socket.

  • cat /etc/docker/daemon.json

    Shows the Docker settings, including the hosts line that sets which addresses it listens on.

  • systemctl cat docker.service

    Shows the Docker service settings, including override files that add -H tcp://...

  • docker context create remote --docker host=ssh://docker-user@host1.example.com

    Creates a context named remote, which manages Docker on the remote server over SSH, without opening a Docker port.

  • docker context use remote

    Sends all following docker commands to the remote server.

  • ufw deny 2375/tcp

    Blocks incoming connections to port 2375 (UFW).

  • firewall-cmd --permanent --remove-port=2375/tcp

    Removes a firewalld rule that opened port 2375. Then run firewall-cmd --reload.

Port 2375 in the IANA registry

Port Protocol Service IANA registry description
2375 TCP docker Docker REST API (plain text)
2375 UDP Reserved Reserved

Data source: IANA Service Name and Transport Protocol Port Number Registry (opens in a new tab)

Port 2375 FAQ

How do I manage Docker on a remote server without opening port 2375?

The simple way is SSH. Create a context with docker context create remote --docker host=ssh://docker-user@host1.example.com, switch to it with docker context use remote, and from then on every docker command runs on the remote server through the encrypted SSH connection.

What's the difference between port 2375 and port 2376?

On port 2375, the connection to Docker is neither encrypted nor authenticated. On port 2376, the connection is encrypted with TLS, and with the tlsverify option only a client with a signed certificate can connect.

How do I check that Docker isn't listening on the network?

Run ss -tlnp | grep dockerd. When there is no output, Docker accepts commands only through the local socket. When an address such as 0.0.0.0:2375 appears, remove the setting from the /etc/docker/daemon.json file or from the service settings, and restart Docker.

Where can I find more useful Docker commands?

The Docker commands page collects the commands for managing containers, images and volumes, and the Docker Compose commands page has the commands for managing several services together.

Shopping cart

Your cart is emptyYou can start with one of our popular plans.

Site search

Accessibility

Text size
100%
Accessibility statement