Docker says the network you named does not exist
Error response from daemon: network myapp not foundShort answer
A container or Compose file refers to a network name the daemon does not have. List networks with docker network ls and compare the exact name. Then create the network yourself, correct the name in the file, or stop whatever deleted it. Compose never creates external networks.
Fix it fast
1Find out which cause you have
List the networks the daemon has and filter by the name in the error.
docker network ls --filter name=myapp2Match what you see, then jump to its fix
- 1
The Compose file has external: true under the network, and the list shows nothingThe network is marked external and was never createdFix - 2
The list shows a similar name, such as a project prefix before the nameThe name is not what you think it isFix - 3
The error appears after docker compose down or after cleanup, for a container started with --networkcompose down removed the network a container still usesFix
- 1
What does the error look like?
Error response from daemon: network myapp not found
Cause 1 of 3
The network is marked external and was never created
1Check
With external: true, Compose does not create the network and returns an error if it does not exist.
grep -n -B2 -A2 'external' compose.yaml2Fix
Create the network once with the exact name, then start the project.
docker network create myapp
docker compose up -d3Verify
The network is listed and the containers are attached.
docker network ls --filter name=myappConfirmed by docs.docker.com
Cause 2 of 3
The name is not what you think it is
1Check
A network that Compose creates for you gets a project-scoped name, but a name set with the name attribute is used as is, with no project prefix.
docker network ls2Fix
Use the full name from the list when you run containers by hand, or set the name attribute in the Compose file so both agree.
networks:
default:
name: myapp3Verify
Start the project and look for the exact name.
docker compose up -d
docker network ls --filter name=myappConfirmed by docs.docker.com
Cause 3 of 3
compose down removed the network a container still uses
1Check
Compose down removes the networks defined in the file's networks section. External networks are never removed.
docker ps -a --format '{{.Names}}' | head2Fix
Create the network again before starting containers by hand, or declare it as external in the file that owns the containers.
docker network create myapp
docker run -d --network myapp --name web nginx3Verify
The container runs and is attached to the network.
docker network inspect myappConfirmed by docs.docker.com
How do I stop it coming back?
- Create shared networks in a setup script or in one Compose file that owns them.
- Use the name attribute so the real network name is explicit.
- Before cleanup commands, list what each one removes.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Servers
apk cannot find py-pip in an Alpine Docker image
py-pip (no such package):
On current Alpine releases there is no package called py-pip.
2 causes, each with a fixServers
ng serve runs in the container but localhost:4200 does not open
The browser cannot open localhost:4200 although ng serve is running in the container
ng serve listens on localhost by default, which inside a container is the container itself.
3 causes, each with a fixServers
Angular routes return 404 from nginx when you refresh or open a link
The home page loads, but refreshing /some/route shows an nginx 404
Angular routes like /users/42 are not files, so nginx looks for them on disk and returns 404.
3 causes, each with a fixServers
AH00558: Apache in Docker cannot reliably determine its fully qualified domain name
Set the 'ServerName' directive globally to suppress this message
AH00558 is a warning, not a crash.
2 causes, each with a fixServers
Apache in a Docker container logs AH01114 when it proxies to a backend
AH01114: HTTP: failed to make connection to backend: api
Apache's proxy worker could not open a connection to the address in ProxyPass.
5 causes, each with a fixServers
Apache logs SIGWINCH and exits on its own
the httpd container stops although nothing crashed
SIGWINCH is Apache's graceful-stop signal.
2 causes, each with a fix