This is accomplished by binding the Docker port to 0.0.0.0, which in affect binds the port to every available network interface on your device.

Step 1 - Editing the Docker Service file

I am doing this on Debian 10, which doesn’t have sudo installed. So instead I am using the root account to make the changes.

su
# prompted for root password

The file is located at /lib/systemd/system.

nano /lib/systemd/system/docker.service

Find ExecStart in the file. (You can use CTRL+W and type ExecStart, then hit enter to find it quicker.) Once the line is found, to bind the port add:

-H tcp://0.0.0.0:2375

The line should look like this:

ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2375 --containerd=/run/containerd/containerd.sock

Save the file CTRL+X, y for yes and done!

Step 2 - Restarting Everything

Since the service file has been changed we need to reload the Docker daemon and restart the Docker service.

Reload the Docker Daemon:

systemctl daemon-reload

Reload the Docker Service:

systemctl restart docker

Now you can logout of the root user and test if you can access the Docker host from a rmeote machine.

I recommend connecting to the host using Docker Context!