Docker Cheat Sheet/Remove a stopped container

Remove one or more stopped containers.

Section: Containers

Remove a stopped container

bash
bash
docker rm web
Explanation

Use `-f` to remove a running container.

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
Force remove a running container
Force-remove a running container.
OpenIn sheetbashsame section
Run and remove on exit
Automatically remove the container after it exits.
OpenIn sheetbashsame section
Prune stopped containers
Remove all stopped containers.
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