LinuxCommandLibrary

podman-rm

TLDR

Remove container

$ podman rm [container]
copy
Force remove running container
$ podman rm -f [container]
copy
Remove multiple containers
$ podman rm [container1] [container2]
copy
Remove all stopped containers
$ podman rm $(podman ps -aq)
copy
Remove container and volumes
$ podman rm -v [container]
copy

SYNOPSIS

podman rm [options] container...

DESCRIPTION

podman rm removes one or more containers. By default, only stopped containers can be removed. Use --force to remove running containers.

PARAMETERS

-f, --force

Force removal of running container.
-v, --volumes
Remove associated volumes.
-a, --all
Remove all containers.
-l, --latest
Remove most recent container.
--depend
Remove dependencies too.

EXAMPLES

$ # Remove stopped container
podman rm mycontainer

# Force remove running container
podman rm -f webserver

# Remove by ID
podman rm abc123def456

# Remove all containers
podman rm -a

# Remove with volumes
podman rm -v database

# Remove latest container
podman rm -l

# Prune stopped containers
podman container prune
copy

CAVEATS

Cannot remove running containers without --force. Volumes not removed unless -v specified.

HISTORY

podman rm is part of Podman, the daemonless container engine by Red Hat providing Docker-compatible container management.

SEE ALSO

Copied to clipboard