The Docker "network not found" error occurs when you try to connect a container to a network that does not exist or has been deleted. This is typically resolved by creating the missing network or recreating your containers with the correct network configuration.
This error indicates that Docker cannot locate the specified network when attempting to start a container or connect it to a network. The Docker daemon maintains a list of available networks, and when you reference a network by name or ID that isn't in this list, the operation fails. This commonly happens after a Docker restart when networks were created by docker-compose but the containers referencing them are trying to start before the networks are recreated. It can also occur if someone manually deleted a network that containers still depend on, or if there's a typo in the network name.
First, check which networks currently exist to see if your network is missing:
docker network lsLook for your network name in the output. If it's not listed, you'll need to create it.
If the network doesn't exist, create it manually:
docker network create mynetworkFor bridge networks with custom configuration:
docker network create --driver bridge --subnet 172.28.0.0/16 mynetworkIf you're using docker-compose, run with flags to recreate networks and remove orphaned containers:
docker-compose down --remove-orphans
docker-compose up -dThe --remove-orphans flag cleans up containers from previous runs that may be referencing deleted networks.
For persistent issues, force Docker to recreate everything:
docker-compose up --force-recreate --remove-orphansThis rebuilds all containers and their network connections from scratch.
If your docker-compose.yml declares a network as external, you must create it manually before running compose:
# docker-compose.yml
networks:
mynetwork:
external: trueCreate the external network first:
docker network create mynetwork
docker-compose up -dIf other steps fail, perform a system cleanup:
docker-compose down
docker system prune
docker-compose up -dWarning: docker system prune removes all unused containers, networks, and dangling images. Use docker system prune -a to also remove unused images.
If issues persist, restart the Docker daemon:
sudo systemctl restart dockerVPN Interference: Some VPN software (like Cisco AnyConnect) can interfere with Docker networking. If you experience persistent network issues, try disconnecting from VPN and resetting Docker to factory settings in Docker Desktop.
Swarm Mode Networks: When using Docker Swarm, networks created for stack services are scoped to the swarm. If you're moving between standalone and swarm mode, networks may not be visible in both contexts. Use docker network ls --filter driver=overlay to see swarm networks.
Network ID vs Name: Docker internally tracks networks by ID. If you see an error referencing a long hash like network 7808732465bd529e6f20e4071115218b..., this is a stale reference to a deleted network. The solution is the same: recreate containers so they get fresh network connections.
dockerfile parse error line 5: unknown instruction: RRUN
How to fix 'unknown instruction' Dockerfile parse error in Docker
Error response from daemon: manifest for nginx:nonexistent not found: manifest unknown: manifest unknown
How to fix 'manifest for image:tag not found' in Docker
Error response from daemon: invalid reference format: repository name must be lowercase
How to fix 'repository name must be lowercase' in Docker
Error response from daemon: No such image
How to fix 'No such image' in Docker
Error response from daemon: Container is not running
How to fix 'Container is not running' when using docker exec