a network with name fix10-cs-q2_default exists but was not created by compose.\nSet `external: true` to use an existing network (the \n is printed as is) — a warning: a network with the exact name Compose wanted for the project was already there, made by hand with docker network create. Remove that network, or tell Compose to use it with external: true.

If nothing else needs the hand-made network, docker network rm it and let Compose create its own. If you want to keep it, declare it under networks: with its name: and external: true.

The error

It is a warning, and up exited with code 0. Captured after creating the network by hand:

PS> docker network create fix10-cs-q2_default
d346b82733acdd08a811f15ce35f5dd7903762de7c5d2e9799fab8f2fa121abb
PS> docker compose -p fix10-cs-q2 up
time="2026-11-13T11:04:09+05:30" level=warning msg="a network with name fix10-cs-q2_default exists but was not created by compose.\nSet `external: true` to use an existing network"
 Container fix10-cs-q2-web-1 Creating
...
web-1  | web started
...

The file was one alpine service running echo web started, with no networks: section. A second run, with a new hand-made network, showed where the container went: docker inspect listed it on fix10-cs-q2_default with the same network ID that docker network create had printed, and the network carried no labels.

PS> docker network create fix10-cs-q2_default
9c61afd1510e7435ace4ed00da071cd73f1c06634b232a684d5ac5c3102c8270
...
PS> docker inspect --format "{{json .NetworkSettings.Networks}}" fix10-cs-q2-web-1
{"fix10-cs-q2_default":{"IPAMConfig":null,"Links":null,"Aliases":["fix10-cs-q2-web-1","web"],"DriverOpts":null,"GwPriority":0,"NetworkID":"9c61afd1510e7435ace4ed00da071cd73f1c06634b232a684d5ac5c3102c8270",...}}
PS> docker network inspect --format "{{.Name}} {{.Labels}}" fix10-cs-q2_default
fix10-cs-q2_default map[]

Why it happens

For a project named fix10-cs-q2 Compose uses a default network called fix10-cs-q2_default. A network of that name already existed, created outside Compose, so Compose warned that it was not its own and attached the container to it; no "Network ... Creating" line appears in the output.

The difference shows on the way out. docker compose down -v removed the container and left the network in place, because Compose had not created it:

PS> docker compose -p fix10-cs-q2 down -v
 Container fix10-cs-q2-web-1 Stopping
...
 Container fix10-cs-q2-web-1 Removed
PS> docker network ls --filter name=fix10-cs-q2 --format {{.Name}}
fix10-cs-q2_default

The fix

Either remove the hand-made network and let Compose create its own:

PS> docker network rm fix10-cs-q2_default
fix10-cs-q2_default
PS> docker compose -p fix10-cs-q2 up
 Network fix10-cs-q2_default Creating
...
 Network fix10-cs-q2_default Created
...

No warning this time, and the next down -v removed the network too. Or keep the network and declare it as external:

services:
  web:
    image: alpine
    command: ["echo", "web started"]
networks:
  default:
    name: fix10-cs-q2_default
    external: true

With this file, run as project fix10-cs-q2x, up printed no warning and no "Network ... Creating" line, and down -v removed only the container.

How it was reproduced

A network created with docker network create fix10-cs-q2_default, then a one-service alpine file started with docker compose -p fix10-cs-q2 up from Windows PowerShell 5.1; then the external declaration as project fix10-cs-q2x, and finally the network removed and the first file started again. Docker Compose v5.7.0, Docker Engine 29.9.3, Docker Desktop 4.99.0 on Windows (version 10.0.26300). The names with fix10-cs-q2 are this test's own; every project was removed with docker compose down -v and the network is gone.

Frequently asked

What does 'network exists but was not created by compose' mean?
A network with the name Compose wants for the project already exists and was made outside Compose. In this test Compose printed the warning, attached the container to that network and exited with code 0.
Does docker compose down remove a network it did not create?
No. In this test docker compose down -v removed the container and left the hand-made network in docker network ls.
How do I use an existing network in docker compose?
Declare it under networks with its name and external: true. In this test that removed the warning, and down -v left the network alone.

More decoded errors in the Fixes category. When an external network is missing instead, see Docker Compose: network declared as external but could not be found.