Enable Docker Remote API

  1. Navigate to /lib/systemd/system in your terminal and open docker.service file
    vi /lib/systemd/system/docker.service
  2. Find the line which starts with ExecStart and adds -H=tcp:// to make it look like
    ExecStart=/usr/bin/dockerd -H=fd:// -H=tcp://
  3. Save the Modified File
  4. Reload the docker daemon
    systemctl daemon-reload
  5. Restart the container
    sudo service docker restart

source: https://medium.com/@ssmak/how-to-enable-docker-remote-api-on-docker-host-7b73bd3278c6