# podman rm: Remove Containers in CI

> podman rm deletes stopped containers. Reference for -f, -a, --volumes, and the in-use and name-conflict errors that surface in pipelines.

Source: https://latchkey.dev/learn/command-reference/podman-rm  
Updated: 2026-06-30

podman rm removes one or more containers, freeing the name and any anonymous volumes if asked.

Cleaning up containers keeps a runner from accumulating cruft and avoids name clashes on reused runners. -f stops and removes in one step.

## What it does

podman rm deletes stopped containers by name or ID. With -f it stops a running container first; with -a it targets all containers. --volumes also removes anonymous volumes created with the container.

## Common usage

```Terminal
podman rm db
podman rm -f app
podman rm -a -f
podman rm --volumes db
```

## Options

| Flag | What it does |
| --- | --- |
| -f, --force | Stop and remove a running container |
| -a, --all | Remove all containers |
| -v, --volumes | Also remove anonymous volumes of the container |
| -i, --ignore | Ignore errors for containers that do not exist |
| --time <n> | Seconds to wait before killing on force |

## In CI

Prefer --rm on podman run so containers self-clean. When that is not possible, use podman rm -f --ignore in a cleanup step so a missing container does not fail the job. On reused runners, a leftover container causes the next run name conflict.

## Common errors in CI

"Error: cannot remove container ... as it is running, stop or use -f" means the container is still up; add -f. "Error: no container with name or ID ... found" is cleared with --ignore in teardown. A name conflict on the next run ("the container name ... is already in use") means a prior container was never removed; rm it first or use --replace on run.

## FAQ

### podman rm: Remove Containers in CI?

Cleaning up containers keeps a runner from accumulating cruft and avoids name clashes on reused runners. -f stops and removes in one step.

### What it does?

podman rm deletes stopped containers by name or ID. With -f it stops a running container first; with -a it targets all containers. --volumes also removes anonymous volumes created with the container.

### In CI?

Prefer --rm on podman run so containers self-clean. When that is not possible, use podman rm -f --ignore in a cleanup step so a missing container does not fail the job. On reused runners, a leftover container causes the next run name conflict.

### Common errors in CI?

"Error: cannot remove container ... as it is running, stop or use -f" means the container is still up; add -f. "Error: no container with name or ID ... found" is cleared with --ignore in teardown. A name conflict on the next run ("the container name ...

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
