Docker Compose Down vs Stop: What Each Removes (and -v)

Updated 6 min read By the Self-Hosting HQ Editorial Team
Quick answerdocker compose stop halts a project's running containers but keeps them, so docker compose start resumes them exactly as they were. docker compose down stops and removes the containers plus the project's networks, but keeps named volumes and bind-mounted data. Only down -v (or --volumes) deletes named volumes declared in the Compose file and anonymous volumes, which permanently erases data stored in them.

The difference in docker compose down vs stop is the difference between pausing a project and tearing it down. stop halts the containers but leaves them in place; down stops them and then removes the containers and the networks Compose created. Neither touches your named volumes unless you add one flag, -v, and that flag is where most accidental data loss happens.

This guide uses Docker’s official command reference as of December 2026 and the Compose plugin syntax (docker compose, with a space). It explains what each command removes, what survives, and which one to run for common home-server situations.

Down vs stop at a glance

Command Stops containers Removes containers Removes project networks Removes named volumes Removes anonymous volumes Removes images
docker compose stop Yes No No No No No
docker compose down Yes Yes Yes No No No
docker compose down -v Yes Yes Yes Yes Yes No
docker compose down --rmi all Yes Yes Yes No No Yes
docker compose rm -s Yes Yes No No No (unless -v) No

Docker’s reference for stop says it “Stops running containers without removing them. They can be started again with docker compose start.” For down, it lists exactly what is removed: containers for services in the Compose file, networks defined in its networks section, the default network if one is used, and retained pre_start hook containers. External networks and volumes are never deleted.

What docker compose stop does

stop sends each running container a stop signal and waits. The container still exists afterwards, along with its writable layer, its logs and its network attachment, so start brings it back exactly as it was:

docker compose stop
docker compose ps -a
docker compose start

stop halts every service in the project (you can name specific services, for example docker compose stop web). ps -a lists the project’s containers including stopped ones, showing them as exited. start “Starts existing containers for a service,” without recreating anything.

Because start reuses the existing containers, it will not pick up changes you made to compose.yaml. That’s useful when you want a temporary pause (to free memory, or to take a consistent copy of data) and nothing else.

Why stopping sometimes takes 10 seconds

Docker’s Compose FAQ explains that Compose sends SIGTERM, waits about 10 seconds, then sends SIGKILL. If every stop takes that long, the app inside isn’t handling SIGTERM. You can change the wait per command with -t/--timeout (in seconds), or per service with stop_grace_period. Databases and apps like Home Assistant often benefit from a longer grace period so they can shut down cleanly:

docker compose stop -t 60

What docker compose down does

down is the opposite of up: it stops the containers, removes them, and removes the project’s networks. Your next docker compose up -d creates fresh containers from the current compose.yaml and image:

docker compose down
docker compose up -d

What survives down:

  • Named volumes (for example db-data: declared at the bottom of compose.yaml).
  • Bind mounts such as ./data:/var/lib/app, because they’re just folders on the host.
  • Images, unless you add --rmi.
  • External networks and volumes, which down never deletes.

What’s lost: anything an app wrote inside its container filesystem rather than in a volume or bind mount. Docker’s rm reference makes the same point: data stored outside a volume is lost when containers are removed. If an app loses settings after down, it was missing a volume for its data directory.

Useful down options

  • --remove-orphans removes containers for services you deleted from the Compose file.
  • --rmi local or --rmi all also removes images (local only removes images without a custom tag).
  • -t/--timeout sets the shutdown timeout, like stop -t.
  • -v/--volumes deletes volumes, covered next.

The -v flag: when down deletes data

Docker’s reference describes -v/--volumes as removing “named volumes declared in the “volumes” section of the Compose file and anonymous volumes attached to containers.” In a typical self-hosted stack, the named volume is the database or the app’s data. Running down -v on a production stack is the container equivalent of formatting that data.

Think before typing -vOnly use docker compose down -v when you want a clean slate: a throwaway test stack, or after you've verified a backup. Bind-mounted host folders are not deleted by -v, but named and anonymous volumes are, and there is no undo.

Two related details from Docker’s documentation:

  • Anonymous volumes (created when an image declares a volume you didn’t name) survive a plain down, but because they have random names, Docker notes that a later up won’t mount them automatically. They pile up as orphaned volumes.
  • docker volume prune removes unused local volumes. By default it only removes anonymous volumes; with -a/--all it also removes unused named volumes, which can include the volumes of a stack you just took down. Read the confirmation prompt carefully.

A quick experiment to see the difference

You can confirm the behavior safely with a throwaway stack. Create a folder and a minimal file:

mkdir -p ~/stacks/voltest && cd ~/stacks/voltest
nano compose.yaml
services:
  box:
    image: alpine:3
    command: ["sleep", "infinity"]
    volumes:
      - testdata:/data
volumes:
  testdata:

Then run these and watch the output of each ls:

docker compose up -d
docker compose exec box sh -c 'echo hello > /data/file.txt'
docker compose stop && docker compose ps -a
docker compose down && docker volume ls
docker compose up -d && docker compose exec box cat /data/file.txt
docker compose down -v && docker volume ls

After stop, the container is listed as exited. After down, the container is gone but docker volume ls still shows a volume named voltest_testdata, and the file is still there when the stack comes back up. After down -v, the volume no longer appears. The volume name is prefixed with the project name, which defaults to the folder name.

Working with a single service

Both commands accept service names, which is often what you actually want on a home server where one project holds an app plus its database. To stop only the web front end while the database keeps running:

docker compose stop web
docker compose start web

down has no per-service form, because it tears down the project as a whole, including its network. To remove just one service’s container, use rm with the stop flag, then recreate it:

docker compose rm -s web
docker compose up -d web

Docker’s rm reference describes -s/--stop as stopping the containers “if required, before removing,” and notes that anonymous volumes attached to the container are kept unless you add -v. Named volumes are never touched by rm. Running up -d web afterwards creates a fresh container for that service from the current file, leaving the other services alone.

Goal Command Applies compose.yaml changes?
Bounce a stuck service docker compose restart web No
Apply edits to compose.yaml docker compose up -d Yes, recreates changed services
Update to newer images docker compose pull then up -d Yes
Force fresh containers docker compose up -d --force-recreate Yes, even if unchanged

Docker’s restart reference states that changes to the Compose file “are not reflected after running this command,” so editing an environment variable and running restart won’t do anything. up -d is the command that reconciles running containers with the file; Docker’s up reference says it stops and recreates changed containers while preserving mounted volumes.

Which one should you use?

  1. Pausing a service for a while, planning to resume as-is: stop, then start.
  2. Applying configuration changes: just up -d. You rarely need down first.
  3. Taking a consistent backup of bind-mounted data: stop (or down), copy the data folder, then start or up -d.
  4. Moving a stack to another server, or renaming the project folder: down on the old location, copy data, up -d on the new one.
  5. Removing services you deleted from the file: up -d --remove-orphans or down --remove-orphans.
  6. Destroying a test stack completely: down -v, and only then.

Before you tear anything down

  • Run docker compose config and check which volumes: each service uses, so you know where its data really lives.
  • Prefer bind mounts in a per-stack folder for data you care about; it makes backups a simple folder copy.
  • Keep a backup on a different disk or machine before upgrades or migrations.
  • Avoid -v and docker volume prune --all in shell history you might rerun by accident with the up arrow.

If you’re still converting docker run commands into files, start with docker compose vs docker run. For installation, see installing Docker Compose on Ubuntu, and browse the Docker section for more.

Frequently asked questions

Does docker compose down delete my data?

Not by default. It removes containers and networks, but named volumes and bind-mounted folders stay. Data written only inside a container's own filesystem, outside any volume, is lost when the container is removed.

Does docker compose down remove images?

No, unless you add --rmi. With --rmi local it removes only images without a custom tag; with --rmi all it removes every image the services used.

Why does docker compose stop take about 10 seconds?

Compose sends SIGTERM and waits for the container to exit, then sends SIGKILL. A consistent delay means the app isn't handling SIGTERM. You can change the wait with -t or stop_grace_period.

Will docker compose restart apply changes to compose.yaml?

No. Docker's reference says changes to the Compose file are not reflected after restart. Run docker compose up -d to recreate the affected containers with the new configuration.

Sources

  1. docker compose down: Docker Docs
  2. docker compose stop: Docker Docs
  3. docker compose start: Docker Docs
  4. docker compose rm: Docker Docs
  5. docker compose restart: Docker Docs
  6. docker compose up: Docker Docs
  7. Volumes: Docker Docs
  8. docker volume prune: Docker Docs
  9. Frequently asked questions (Compose): Docker Docs
Written and maintained by the Self-Hosting HQ Editorial Team

We research every guide from manufacturer documentation, government and standards bodies, and other primary sources, which are cited at the end of each article. We do not accept payment for coverage. Read our editorial policy to see how articles are researched, fact-checked and updated, or tell us if something is out of date.