Docker Compose Rm Command
# docker compose rm Command
[Docker Command Manual](#)
* * *
The docker compose rm command is used to delete stopped service containers.
The docker compose rm command does not delete running containers. It is primarily used to clean up stopped or no longer needed containers to free up system resources.
### Syntax
docker compose rm [SERVICE...]
* **SERVICE** (Optional): The name of the service container(s) to delete. If no service name is specified, all stopped service containers will be deleted.
**OPTIONS:**
* `-f, --force`: Force delete containers without prompting for user confirmation.
* `-s, --stop`: Stop running containers first, then delete them.
* `-v, --volumes`: Also delete the volumes associated with the containers.
### Examples
**1. Delete all stopped service containers**
docker compose rm
Lists and prompts to delete all stopped service containers.
**2. Force delete all stopped service containers**
docker compose rm -f
Deletes stopped containers directly without prompting for user confirmation.
**3. Delete stopped containers for a specific service**
docker compose rm web
Deletes only the stopped containers for the web service.
**4. Delete and clean up associated volumes**
docker compose rm -v
Deletes stopped containers and simultaneously deletes the volumes associated with them.
* * Docker Command Manual](#)
YouTip