Docker Cheat Sheet/Prune stopped containers

Remove all stopped containers.

Section: Containers

Prune stopped containers

bash
bash
docker container prune
Explanation

Helpful for reclaiming clutter and space.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Containers
Run and remove on exit
Automatically remove the container after it exits.
OpenIn sheetbashsame section
Remove a stopped container
Remove one or more stopped containers.
OpenIn sheetbashsame section
Force remove a running container
Force-remove a running container.
OpenIn sheetbashsame section
Run a container
Create and start a new container.
OpenIn sheetbashsame section
Run detached
Run a container in the background.
OpenIn sheetbashsame section
Run interactively
Run an interactive shell inside a new container.
OpenIn sheetbashsame section