Docker: network not found
Fix 'network not found' when Docker Compose references a network that was removed by docker compose down.
Docker produces "network {name} not found" when a container references a Docker network that does not exist — typically after
docker compose downremoved it.
What Causes This Error
docker compose down removes the project's networks by default. Starting individual containers that reference those networks fails because the network no longer exists.
How to Fix
- Recreate the network by starting the full Compose stack:
docker compose up -d- Or create the network manually:
docker network create myapp_default- For persistent cross-project networks, define them as
externalindocker-compose.yml:
networks:
shared:
external: trueCreate the external network once:
docker network create shared.