.nh .TH "DOCKER" "1" "Aug 2026" "Docker Community" "Docker User Manuals" .SH NAME docker-container-rm - Remove one or more containers .SH SYNOPSIS \fBdocker container rm [OPTIONS] CONTAINER [CONTAINER...]\fP .SH DESCRIPTION \fBdocker container rm\fP will remove one or more containers from the host node. The container name or ID can be used. This does not remove images. You cannot remove a running container unless you use the \fB-f\fP option. To see all containers on a host use the \fBdocker container ls -a\fP command. .SH EXAMPLES .SH Removing a container using its ID To remove a container using its ID, find either from a \fBdocker ps -a\fP command, or use the ID returned from the \fBdocker run\fP command, or retrieve it from a file used to store it using the \fBdocker run --cidfile\fP: .EX docker container rm abebf7571666 .EE .SH Removing a container using the container name The name of the container can be found using the \fBdocker ps -a\fP command. The use that name as follows: .EX docker container rm hopeful_morse .EE .SH Removing a container and all associated volumes .EX $ docker container rm -v redis redis .EE .PP This command will remove the container and any volumes associated with it. Note that if a volume was specified with a name, it will not be removed. .EX $ docker create -v awesome:/foo -v /bar --name hello redis hello $ docker container rm -v hello .EE .PP In this example, the volume for \fB/foo\fR will remain in tact, but the volume for \fB/bar\fR will be removed. The same behavior holds for volumes inherited with \fB--volumes-from\fR\&. .SH OPTIONS \fB-f\fP, \fB--force\fP[=false] Force the removal of a running container (uses SIGKILL) .PP \fB-l\fP, \fB--link\fP[=false] Remove the specified link .PP \fB-v\fP, \fB--volumes\fP[=false] Remove anonymous volumes associated with the container .SH SEE ALSO \fBdocker-container(1)\fP