Docker networking allows containers to communicate with each other and the outside world.
**Default network types:**
1. **bridge** (default) — containers on same host can communicate via container name
2. **host** — container shares host's network stack (no isolation)
3. **none** — completely isolated, no networking
4. **overlay** — connects containers across multiple Docker hosts (used with Swarm/K8s)
**Create a custom network:**
```bash
docker network create my-network
docker run --network my-network --name db mysql:8
docker run --network my-network --name app my-node-app
# 'app' can now reach 'db' using the hostname 'db'
```
**Docker Compose (recommended for multi-container apps):**
```yaml
services:
web:
image: nginx
api:
image: my-api
db:
image: postgres
# All three are on the same network automatically
```