Error: docker: 'daemon' is not a docker command

In Ubuntu studio 20.04.1 Docker installation - installed just fresh on October 2020…, I give commands:
// according to page 23 [TECHNIQUE 1 Open your Docker daemon to the world] of the book “Docker in Practice
SECOND EDITION”, ©2019 by Manning Publications Co. :

========================================
sudo service docker stop sudo docker daemon -H tcp://0.0.0.0:2375

======================================== getting >>>
leonidas@ubuntu:~ sudo docker daemon -H tcp://0.0.0.0:2375 docker: 'daemon' is not a docker command. See 'docker --help' leonidas@ubuntu:~

Do you have any idea/hint on what to do??? I search online but Not found a solution…

The binary is called dockerd and is located in /usr/bin/dockerd.
Why would they want to stop docker as a service and then run it with a command? Strange exercise…

I would strongly suggest to do any daemon configuration to the file /etc/docker/daemon.json. If it does not exist, create it.The equivalent of what you try to do with the command is:

{
   "hosts" : [ "tcp://0.0.0.0:2375" ]
}

If the file exists, do not replace it with the example I pasted! Modify the hosts line if existing, add the hosts line , if missing. Keep in mind: this is a json file!

Though, you might want to keep the binding to the docker.sock as well:

{
   "hosts" : [ "tcp://0.0.0.0:2375", "unix:///var/run/docker.sock" ]
}

Then restart the daemon with sudo service docker restart and you are done.

WARNING: everyone who can access your docker machine, will be able to connect to it with a remote docker client or application that implements the docker sdk without authentification. You will not want to enable this, unless you enable certificate auth (see: https://docs.docker.com/engine/security/https/). Even better don’t enable the http socket at all, and leverage docker context, which allows to controll remote docker engines over ssh (see: Docker context problem).

Thanks for your reply

So daemon was the old name… ?
I must use dockerd for the new version of docker?

I use in Ubuntu VM the docker practicing commands of this book
This VM is for testing, so is Not any danger to impacted or attack me, some hacker to the Windows 10 host OS, correct?

my book says run:

$ docker -H tcp://<your host’s ip>:2375

to connect to my Docker from the network, how to find Ubuntu VM IP…?

leonidas@ubuntu:~$ ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:0c:29:cd:03:30 brd ff:ff:ff:ff:ff:ff
    inet 192.168.217.129/24 brd 192.168.217.255 scope global dynamic noprefixroute ens33
       valid_lft 1311sec preferred_lft 1311sec
    inet6 fe80::fc78:9998:759f:a6f8/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 02:42:01:23:5a:50 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever
leonidas@ubuntu:~$

I mean how to learn my VM/Ubuntu IP address?

my book says run: // I connected and started dockerd server with: sudo dockerd -H tcp://0.0.0.0:2375

$ docker -H tcp://<your host’s ip>:2375

to connect to my Dockerd from the network, how to find Ubuntu VM IP[<your host’s ip>]…?

leonidas@ubuntu:~$ sudo dockerd -H tcp://0.0.0.0:2375
INFO[2020-10-30T12:28:21.007042504-07:00] Starting up
WARN[2020-10-30T12:28:21.007960408-07:00] [!] DON’T BIND ON ANY IP ADDRESS WITHOUT setting --tlsverify IF YOU DON’T KNOW WHAT YOU’RE DOING [!]
INFO[2020-10-30T12:28:21.009620669-07:00] detected 127.0.0.53 nameserver, assuming systemd-resolved, so using resolv.conf: /run/systemd/resolve/resolv.conf
INFO[2020-10-30T12:28:21.011635635-07:00] parsed scheme: “unix” module=grpc
INFO[2020-10-30T12:28:21.011734670-07:00] scheme “unix” not registered, fallback to default scheme module=grpc
INFO[2020-10-30T12:28:21.011785495-07:00] ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/containerd.sock 0 }] } module=grpc
INFO[2020-10-30T12:28:21.011809428-07:00] ClientConn switching balancer to “pick_first” module=grpc
INFO[2020-10-30T12:28:21.014896413-07:00] parsed scheme: “unix” module=grpc
INFO[2020-10-30T12:28:21.015010625-07:00] scheme “unix” not registered, fallback to default scheme module=grpc
INFO[2020-10-30T12:28:21.015065269-07:00] ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/containerd.sock 0 }] } module=grpc
INFO[2020-10-30T12:28:21.015081620-07:00] ClientConn switching balancer to “pick_first” module=grpc
INFO[2020-10-30T12:28:21.028942240-07:00] [graphdriver] using prior storage driver: overlay2
WARN[2020-10-30T12:28:21.035451449-07:00] Your kernel does not support swap memory limit
WARN[2020-10-30T12:28:21.035486087-07:00] Your kernel does not support cgroup rt period
WARN[2020-10-30T12:28:21.035491493-07:00] Your kernel does not support cgroup rt runtime
WARN[2020-10-30T12:28:21.035499364-07:00] Your kernel does not support cgroup blkio weight
WARN[2020-10-30T12:28:21.035504413-07:00] Your kernel does not support cgroup blkio weight_device
INFO[2020-10-30T12:28:21.035631782-07:00] Loading containers: start.
INFO[2020-10-30T12:28:21.136500755-07:00] Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address
INFO[2020-10-30T12:28:21.177144086-07:00] Loading containers: done.
INFO[2020-10-30T12:28:21.196087060-07:00] Docker daemon commit=4484c46d9d graphdriver(s)=overlay2 version=19.03.13
INFO[2020-10-30T12:28:21.196150156-07:00] Daemon has completed initialization
INFO[2020-10-30T12:28:21.213806949-07:00] API listen on [::]:2375

=====

my book says run:

$ docker -H tcp://<your host-Docker-VM-in-my-case’s ip>:2375