Network not found
The container engine failed to attach a container because the specified bridge, overlay, or custom network does not exist.
Usually happens because:
- ☑ Custom network has not been created yet
- ☑ Compose expects pre-created external network
- ☑ Typo in the network name
🔍 Quick Checklist:
What is Network not found?
This error occurs when you attempt to run or compose a container with a designated network binding (e.g. --network=my-net or network entries in docker-compose.yml) but the network has not been created or was deleted. Docker containers communicate over virtual networks, and assigning a container to a non-existent network causes the startup configuration to fail.
Common Causes
- Missing network creation: Trying to attach a container to a custom network before executing 'docker network create'.
- Docker Compose external network mismatch: Setting an external network key in your compose file when the network was not created beforehand on the host.
- Typo in network name: Spelling mistakes in the CLI command or compose file.
| Cause | Frequency |
|---|---|
| Custom network not created yet | ⭐⭐⭐⭐⭐ |
| Compose external network config mismatch | ⭐⭐⭐⭐ |
| Spelling typo in network name | ⭐⭐⭐ |
Common Mistakes
- Declaring `external: true` inside docker-compose files without running the corresponding network creation command beforehand.
- Typoing network names during manual container attachment commands.
How to Fix
Docker Operations & Verification
List all active Docker networks and create a new bridge network.
# 1. List existing network adapters
docker network ls
# 2. Create the missing custom network
docker network create production-bridgePlatform Specific Fixes
Debugging network bridge adapters on Linux hosts.
# Inspect system network interfaces
ip link show
# Inspect docker network configuration details
docker network inspect bridgeBest Practices
- Write initialization shell scripts that check for and create required network adapters before booting application services.
- Keep networks local to individual docker-compose files to allow automated creation and teardown cycles.
Frequently Asked Questions (FAQ)
Q: Why does it say network not found?
The Docker daemon could not find a network adapter matching the name specified in your CLI command or compose configuration.
Q: How do I list existing networks?
Run 'docker network ls' to view all local networks, driver types (bridge, host, none), and IDs.
Q: What is an external network in Docker Compose?
An external network is a network that is created outside the scope of Docker Compose. Declaring 'external: true' tells Compose to use the existing network rather than creating a new one.
Q: How do I delete unused networks?
Run 'docker network prune' to clean up all networks that are not currently referenced by at least one container.