# docker top: View Processes in a Container

> How docker top works: listing the processes running inside a container, ps options, and debugging hung containers in CI.

Source: https://latchkey.dev/learn/command-reference/docker-top-command  
Updated: 2026-06-25

See the processes running inside a container, from the host.

docker top shows the processes running in a container without needing a shell inside it. This page covers passing ps options and debugging a hung container.

## What it does

docker top runs ps on the host scoped to the container processes, so it works even when the image has no ps binary. You can append standard ps options.

## Common usage

```Terminal
docker top web
docker top web aux
docker top web -eo pid,comm,%cpu,%mem
```

## Common errors in CI

"Container ... is not running" - top only works on running containers; for an exited one read docker logs and the exit code via docker inspect. When a CI job hangs, docker top reveals whether the expected process is actually running or stuck, without needing a shell in a minimal image.

## FAQ

### docker top: View Processes in a Container?

docker top shows the processes running in a container without needing a shell inside it. This page covers passing ps options and debugging a hung container.

### What it does?

docker top runs ps on the host scoped to the container processes, so it works even when the image has no ps binary. You can append standard ps options.

### Common errors in CI?

"Container ... is not running" - top only works on running containers; for an exited one read docker logs and the exit code via docker inspect. When a CI job hangs, docker top reveals whether the expected process is actually running or stuck, without needing a shell in a minimal image.

---

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
