The Command
cd /srv/shop
docker compose downRun it in the folder that holds the project's compose.yaml. Compose stops each service, removes its containers, and removes the networks it created. The services are offline until you start them again with docker compose up -d, which creates new containers. On old installations the same command was written docker-compose down.
What Is Removed and What Stays
| Item | Plain down |
|---|---|
| Containers | Removed |
| Project networks | Removed |
| Named volumes | Kept |
| Anonymous volumes | Kept, but not reused |
| Bind-mounted folders | Kept |
| Images | Kept |
| External networks | Never removed |
| External volumes | Never removed |
Anonymous volumes have no stable name, so the next up creates fresh ones and does not mount the old ones again. Data that must survive belongs in a named volume or a bind mount; see Docker volumes vs bind mounts.
down vs stop
| Command | Effect |
|---|---|
docker compose stop | Stops, keeps containers |
docker compose down | Stops, removes containers |
Use stop for a short pause: docker compose start resumes the same containers. Use down when you want a clean start or before you remove the project. Anything written inside a container's own file system and not in a volume is lost with down.
The -v Option Deletes Your Data
With -v, Compose also deletes the named volumes declared in the file and the anonymous volumes of the containers. For a database service, that is the database itself. There is no undo. Use it only for test projects, or after a backup that you have checked:
- List the project's volumes:
docker volume lsshows names that start with the project name. - Back up each volume you need, or take a server snapshot; see snapshot vs backup.
- Then run the command.
docker compose down -vRemove Images Too
docker compose down --rmi local
docker compose down --rmi all--rmi local removes only images that have no custom tag, which are usually images Compose built for the project. --rmi all removes every image the services use. Both are safe for your data but mean a new pull or build on the next start. For a wider cleanup, see how to remove Docker images.
Orphan Containers
If you rename or delete a service in compose.yaml, its old container is left running as an orphan, and Compose warns about it. Remove such containers with:
docker compose down --remove-orphansThe same option works with up -d.
Run It for the Right Project
Compose finds the project by the folder you are in. The project name defaults to the folder name, and every container, network, and volume carries it. Running down in the wrong folder affects the wrong project, so check first:
docker compose ls
docker compose -f /srv/shop/compose.yaml down
docker compose -p shop downdocker compose ls lists the running projects on the server (add -a to include stopped ones), -f names a file, and -p names a project directly. If a project was started with -p, stop it with the same name.
Timeouts and Logs
down gives each container 10 seconds to stop before it is killed. Give slow services more time with -t 60. If something fails after the next start, read the output with docker logs or docker compose logs.
Updated:
Linux VPS with Full Root Access
MUVCloud cloud servers run on KVM with Enterprise NVMe SSD storage and full root access, in Turkey, the Netherlands, and the USA.
More Guides
No Limits on Service or Support
You are not on your own as your projects grow. Our support engineers are ready 24/7, on several channels, whenever you need them.

- 100% customer satisfaction goal
- Our own hardware
- 24/7 ticket and email support
- 4 countries with locations