Huny's Dev Blog
huny.dev

Docker Compose ps: Find Stopped Containers and Check Logs

Find stopped Compose containers with ps -a, then check status filters, logs, and project scope.

Hun Jang
Hun Jang Nov 16, 2026

If a Compose service disappears from the list, start with docker compose ps -a to include stopped containers. Plain ps shows only running containers, so an empty list does not prove that a service was never created.

AI-generated conceptual illustration of running and stopped containers

This article follows the official Docker Compose ps reference checked on November 16, 2026. Commands are documentation-based examples; Docker was unavailable in this environment, so they were not run against a daemon.

1. Include stopped containers

Run these commands in the project directory containing the Compose file.

The first command shows running containers, their status, and exposed ports. -a also includes stopped containers, including stopped containers created by compose run. Read SERVICE, STATUS, and PORTS together. To inspect a specific service, use its actual name, for example docker compose ps -a web.

exited (0) can mean that the process ended successfully. That may be expected for a one-off job, but a web server expected to stay up needs investigation. restarting means the container is restarting repeatedly. An exit code alone does not establish the cause.

2. Filter exited containers and inspect logs

Replace web with the real service name. The first command filters for exited containers; the second shows recent logs for that service. Logs can contain secrets, so review them before sharing. See the ps reference for status filters and the logs reference for log options.

A running container does not guarantee that its application is ready to serve requests. If a healthcheck is configured, inspect its health status and also test an actual request and application logs. For database readiness, see Docker Compose Startup Order: Wait for Database Readiness with healthcheckDocker Compose Startup Order: Wait for Database Readiness with healthcheck.

3. Check the project if it is still missing

ps operates within a Compose project. A different directory, -f file, project name, or Docker context can produce a different list. Check the settings used for the original deployment and specify the same ones.

Replace myproject with the verified project name. A deleted container or one that failed to be created will not appear even with -a. In that case inspect the original command output and deployment records. Compose project names

4. Use JSON Lines for automation

The current official documentation describes JSON output as JSON Lines, one object per container. This command requires jq installed separately; check available fields and options in your installed Compose version. The list is a snapshot and the state can change afterward.

한국어 버전: Docker Compose ps에서 컨테이너가 안 보일 때: 중지 상태와 로그 확인Docker Compose ps에서 컨테이너가 안 보일 때: 중지 상태와 로그 확인

추천 글