nano /lib/systemd/system/docker.service

and change

ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2375 [...]

and restart docker with:

systemctl daemon-reload
service docker restart

Source: [StackOverflow][1]

tested on:

  • Distributor ID: Ubuntu Description: Ubuntu 17.10 Release: 17.10 Codename: artful
  • Distributor ID: Ubuntu Description: Ubuntu 16.04.4 LTS Release: 16.04 Codename: xenial

[1]: https://stackoverflow.com/questions/26561963/how-to-detect-a-docker-daemon-port