Ad space (banner)
AD

Got the fundamentals? A structured Docker course is a fast way to level up.

Find Docker courses on Udemy

Affiliate link. Costs you nothing extra.

🐳Docker Lessons
Lesson 44 / 45

Stopping Everything with docker compose down

When you are finished, use docker compose down. It stops and removes everything up created.

The syntax is docker compose down. Containers and the network are removed; named volumes survive unless you add -v.

Running docker compose down stops each service, removes the containers, and removes the network created for the project.

A common stumble is running down -v out of habit and wiping the database volume along with it. Use -v deliberately, not reflexively.

In real work, it is how you cleanly tear down a development environment at the end of the day.

Docker
Try it (type this into the pseudo terminal)
docker compose down

🧑‍💻 You can type this command into the Docker pseudo terminal to try it yourself (this page itself has no interactive terminal).

Ad space (banner)
Ad space (in-article)