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 down removed 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

  1. Recreate the network by starting the full Compose stack:
docker compose up -d
  1. Or create the network manually:
docker network create myapp_default
  1. For persistent cross-project networks, define them as external in docker-compose.yml:
networks:
  shared:
    external: true

Create the external network once: docker network create shared.