networks//localhost

`localhost` is the hostname of `127.0.0.1`, the loopback address, through which a program reaches servers on its own machine: traffic sent to it never leaves the machine. It is not part of the private IP ranges (10.x.x.x or 192.168.x.x) but a special class of its own, so `localhost:3000` on one machine is invisible to the other devices of the LAN.


localhost is the hostname of 127.0.0.1, the loopback address, through which a program reaches servers on its own machine: traffic sent to it never leaves the machine. It is not part of the private IP ranges (10.x.x.x or 192.168.x.x) but a special class of its own, so localhost:3000 on one machine is invisible to the other devices of the LAN.

Inside a Docker container, localhost refers to the container itself and not to the host. Each container has its own loopback, and ping localhost inside a container hits the container. Reaching a container's internal port from the host's localhost takes port mapping (-p).