Found orphan containers ([...]) for this project means a container that belongs to this Compose project still exists, but its service is no longer in the file, for example because you renamed or deleted that service. In these tests Compose warned for a leftover container that was running and for one that was stopped, and left it in place. Run docker compose up -d --remove-orphans to stop and remove it.

The warning names the leftover container in the brackets. If that container is one you no longer need, --remove-orphans is the whole fix; if you still need it, put its service back in the file instead.

The error

PS> docker compose up -d
time="2026-11-10T08:50:15+05:30" level=warning msg="Found orphan containers (fix9-cmp-c2-worker-1) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up."
 Container fix9-cmp-c2-web-1 Running
 Container fix9-cmp-c2-jobs-1 Creating
 Container fix9-cmp-c2-jobs-1 Created
 Container fix9-cmp-c2-jobs-1 Starting
 Container fix9-cmp-c2-jobs-1 Started

The command exited with code 0. Before it, the file had two services, web and worker, and both were running. The service worker was then renamed to jobs:

name: fix9-cmp-c2
services:
  web:
    image: alpine
    command: ["sleep", "300"]
  jobs:
    image: alpine
    command: ["sleep", "300"]

Why it happens

Both runs used the same project name, fix9-cmp-c2, set by the name: key, and the warning counts the old container as part of that project. After the rename, the file describes web and jobs, so Compose created a new jobs container and left the old worker one alone. Three containers were running afterwards:

PS> docker compose ps -a
NAME                   IMAGE     COMMAND       SERVICE   CREATED                  STATUS                  PORTS
fix9-cmp-c2-jobs-1     alpine    "sleep 300"   jobs      Less than a second ago   Up Less than a second
fix9-cmp-c2-web-1      alpine    "sleep 300"   web       1 second ago             Up 1 second
fix9-cmp-c2-worker-1   alpine    "sleep 300"   worker    1 second ago             Up 1 second

The output shows a renamed service treated as a new service: the old container kept its name and kept running beside the new one, and docker compose ps -a still listed it under its old service name, worker. In a second run the old container was stopped with docker stop before up; the same warning named it, and docker ps -a showed it as Exited (137) beside the two running ones.

The fix

PS> docker compose up -d --remove-orphans
 Container fix9-cmp-c2-jobs-1 Running
 Container fix9-cmp-c2-web-1 Running
 Container fix9-cmp-c2-worker-1 Stopping
 Container fix9-cmp-c2-worker-1 Stopped
 Container fix9-cmp-c2-worker-1 Removing
 Container fix9-cmp-c2-worker-1 Removed
PS> docker ps -a --filter name=fix9-cmp-c2
CONTAINER ID   IMAGE     COMMAND       CREATED         STATUS         PORTS     NAMES
202d25b6fe7a   alpine    "sleep 300"   4 seconds ago   Up 4 seconds             fix9-cmp-c2-jobs-1
f0754d156c01   alpine    "sleep 300"   5 seconds ago   Up 5 seconds             fix9-cmp-c2-web-1

The flag stopped and removed only the orphan; the two services in the file kept running. Check the name in the warning before you use it: whatever it lists is removed. In this test a later docker compose down -v removed the two remaining containers and the project network.

How it was reproduced

A project named fix9-cmp-c2 with two alpine services running sleep 300 was started with docker compose up -d; one service was then renamed in the file and the same command run again, from Windows PowerShell 5.1 on Docker Engine 29.9.3 and Docker Compose v5.7.0 (Docker Desktop on Windows 11). The names carry this test's fix9-cmp- prefix.

Frequently asked

What are orphan containers in Docker Compose?
Containers that carry the project's name but whose service is no longer in the Compose file, for example after a service was renamed or deleted. In this test the old container kept running.
How do I remove orphan containers in Docker Compose?
Run docker compose up -d --remove-orphans. In this test it stopped and removed only the container named in the warning and left the services in the file running.
Is the Found orphan containers warning an error?
No. The command exited with code 0 and started the new service. The warning tells you an old container is still running beside it.

More decoded errors in the Fixes category. When a command names a service that is not in the file, see Docker Compose: no such service.