Docker Compose Ps Command
# docker compose ps Command
[Docker Command Manual](#)
* * *
docker compose ps command is used to list containers related to the Docker Compose project and their status.
docker compose ps can display the running status, port mappings and other information of all service containers in the current project.
### Syntax
docker compose ps [SERVICE...]
* **SERVICE** (optional): Specify the service name to view the status. If not specified, it will list the status of all service containers.
**OPTIONS:**
* `-a, --all`: List all containers, including stopped containers.
* `-q, --quiet`: Only display container IDs, without other information.
* `--services`: Only list service names, without detailed container information.
* `--filter`: Filter output results based on conditions. For example, containers can be filtered by status.
### Output Information
* **Name**: Container name.
* **Command**: Command running in the container.
* **State**: Container status (e.g., Up, Exited).
* **Ports**: Container port mappings.
### Examples
**1. List all running containers**
docker compose ps
Displays the containers currently running in the project and their status.
**2. List all containers (including stopped containers)**
docker compose ps -a
Lists the status of all containers, including stopped ones.
**3. Display only container IDs**
docker compose ps -q
Returns only the container IDs, without other detailed information.
**4. List all service names**
docker compose ps --services
Displays only the service names, without listing detailed container information.
**5. Filter containers by status**
docker compose ps --filter "status=running"
Lists only containers with status "running".
* * Docker Command Manual](#)
YouTip