How to Fix Docker Compose "Network Not Found" Errors
A "network not found" error in Docker Compose means a container (or Compose itself) is trying to reference a network by name or ID that no longer exists in Docker's current state — usually because it was removed at some point, but something still holds a stale reference expecting it to be there.
The most common cause is running `docker compose down` (which removes the project's networks by default) and then trying to start a container that was created against the old network without going through Compose again — for example, manually running `docker start` on a container that Compose previously created, after the network it depended on was torn down. The container's own configuration still references the old network ID, which Docker can no longer find.
A closely related cause is switching Compose project names or directories. Docker Compose names networks based on the project name (by default, derived from the directory name), and if you've renamed a project folder, changed the `COMPOSE_PROJECT_NAME`, or are running the same compose file from a different location, Compose may be looking for a network name that doesn't match what actually exists, even though the underlying compose.yml file itself hasn't changed.
External networks — networks defined in your compose file but marked as `external: true`, meaning Compose expects them to already exist rather than creating them — cause this error specifically when the referenced network was never created, or was removed outside of Compose's awareness (a `docker network rm` run manually, for instance, or a Docker system prune that cleaned up unused networks).
The most reliable general fix is a clean reset: `docker compose down` to remove the current project's containers and networks cleanly, followed by `docker compose up` to recreate everything from the current compose file's definitions. This resolves the vast majority of stale-network-reference issues, since it rebuilds the network fresh rather than trying to reconcile a mismatch.
If the network is meant to be external and shared across multiple compose projects, confirm it actually exists first with `docker network ls`, and create it explicitly with `docker network create <name>` if it doesn't — external networks are Compose's way of saying 'someone else is responsible for this network existing,' and if nothing has created it yet, Compose will correctly fail rather than silently creating one for you.
For a lingering issue that persists even after a clean `down`/`up` cycle, `docker network prune` clears out any genuinely orphaned networks that Docker's daemon still has stale references to — worth trying if the standard reset doesn't resolve it, since it addresses accumulated Docker-daemon-level cruft rather than anything specific to your current compose file.
Found this helpful?
SyncTonight's tools and guides are free and always will be. If this post saved you some debugging time, a coffee goes a long way — no pressure, just appreciated.
☕ Buy me a coffee