brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: docker compose stop keeps your containers, down removes them

Docker
~/tips/tip-docker-compose-stop-vs-down

docker compose stop

Pick stop for a pause and down for a clean slate.

Both commands make a stack go quiet, but they leave very different things behind. Picking the wrong one either wastes a rebuild or keeps old junk around.

docker compose stop
docker compose start

stop stops the containers and leaves them in place, with their writable layer, logs and network. start brings back exactly the same containers. This suits a short pause, for example while you copy a database folder.

docker compose down

down stops and removes the containers and the project’s networks. The next up creates fresh containers from the Compose file. Named volumes and images stay unless you add -v or --rmi. Logs from the old containers are gone, which matters if you wanted to read why something crashed.

A rule of thumb I’d follow: if you changed nothing, stop; if you changed the file or want a clean start, down and up. Read down -v twice before you press enter, because it deletes the named volumes and the data in them with no way back. And remember that start after a stop ignores edits to the Compose file, just like restart.

Further reading: docker compose stop, docker compose down

More Docker tips ONBUILD RUN /usr/local/bin/python-build --dir /app/src SHELL ["/bin/bash", "-c"] docker commit <container> myname/testimage:version3 docker import /path/to/exampleimage.tgz docker compose events All Docker tips (192) All topics

Link