What is Docker PS Command ?
Last Updated :
22 Apr, 2024
he "docker ps" command is used to list all the running containers in the docker host. With the help of some filters, you can get the output of all the containers in the docker with are running and that are stopped. it shows the list of active containers that includes details about each one, including its name, ID, creation image, program being run inside it, creation time, and status.
"docker ps" Command Complete Step-By-Step Guide
The "docker ps" command will guide us in the docker host by listing all the docker containers. It will list all the docker containers in the docker host.
Sytanx Of "docker ps" Command Without Options
1. Here we will execute the docker ps command without any option or filters and let's see the output we are getting.
docker ps

In the above image, you can see the no.of docker containers that are running inside the docker host "docker ps" command will give us the output of the following.
- Container ID.
- Images that have been used to run the container.
- The command which is used to start the container where we will mention it in the Dockerfile.
- Status of the container.
- ports used to expose the docker container.
Sytanx Of "docker ps" Command With Options
By using multiple options you can perform multiple tasks in the docker host as shown follows.
docker ps <option>
To see all the containers in the docker including the containers which have been exited you use the following command.
docker ps -a
"-a" or "--all" can be used along with the docker command.

"docker ps" Commands With Different Options
You can us the docker ps command with different options which will give us the output depending on the output required.
Command
| Options
|
---|
docker ps "- q" or "--quite"
| Show only the container IDs.
|
docker ps "-- format"
| Specify a Go template to format the output.
|
docker ps "-- filter"
| Filter output based on conditions.
|
‘docker ps’ vs ‘docker container ls’
There is no much difference in between the docker ps and docker container ls as shown in the image below.

- docker container ls: This command lists all the currently running containers. The output shows one container with the following details:
- CONTAINER ID: 1041a2d84eff - This is the unique identifier for the container.
- IMAGE: nginx - This indicates that the container is running an nginx image, which is commonly used as a web server or reverse proxy.
- COMMAND: "/docker-entrypoint..." - This is the command that was used to start the container, and it has been truncated in the display. The full command is likely something like "/docker-entrypoint.sh nginx -g 'daemon off;'", which is the default command for nginx Docker images.
- CREATED: 57 minutes ago - The container was created 57 minutes before the command was run.
- STATUS: Up 57 minutes - This shows that the container has been running since it was created.
- PORTS: 80/tcp - The container has exposed port 80 for TCP traffic, which is the standard port for HTTP web services.
- NAMES: adoring_bell - Docker has automatically assigned a whimsical name to the container, in this case, "adoring_bell".
- docker ps: This is an older command that serves the same purpose as docker container ls, which is to list all running containers. It's commonly used for its brevity and gives the same output as docker container ls.
The output for both commands is identical, showing that there is one running container based on the nginx image. The fact that the commands have been run in sequence with identical output suggests that there has been no change in the status of running containers between the execution of the two commands. The container seems to be running normally, but without additional context, it's not possible to determine what service it is providing or if it is part of a larger application or service.
Conclusion
In conclusion the command docker ps is an effective tool for handling Docker containers. With vital details like container IDs, image names, status, and ports, it enables users to display every container that is currently executing on their Docker host. This command is essential for effectively administering containerised applications, keeping an eye on container activity, and diagnosing problems.
Similar Reads
What Is Docker rm Command ?
Unused Docker images can pile up over time and occupy considerable disk space. Removing these images efficiently helps recover storage and ensures your system remains clutter-free.This guide will walk you through the process of removing unnecessary Docker images from your system. But before diving i
12 min read
What Is Docker Compose Up?
Docker Compose is a powerful tool utilized for defining and running multi-container Docker applications. It improves on the most common way of managing complex applications composed of multiple interconnected services by allowing you to characterize their configuration in a single YAML file.With Doc
15 min read
What is Docker Cloud?
Docker is a software platform that provides some special kind of facilities, like a service provider that allows you to build, test, and deploy your application in centralized processing and quickly. So, the Docker Cloud is basically working as a service provider by Docker in which we can perform su
10 min read
What Is Docker Client ?
Docker is rapidly growing in popularity. It is an open platform based on OCI, Open Container Initiative. The containerization helps separate applications from the underlying infrastructure. Thus, enabling rapid software development and release. Docker Client is the frontend that enables users to int
10 min read
What Is Docker Daemon ?
Docker is synonymous with containerization, yet it is just one of the many implementations of the Open Container Initiative (OCI). As the most widely embraced containerization platform, Docker has greatly streamlined the development and deployment of modern applications. At the core of Docker's oper
6 min read
What is Docker?
Have you ever wondered about the reason for creating Docker Containers in the market? Before Docker, there was a big issue faced by most developers whenever they created any code that code was working on that developer computer, but when they try to run that particular code on the server, that code
12 min read
Docker Prune Command
In the evolution of containerization, management of container environments is essential. In this docker prune a command provides a simplified approach of cleaning up unused resources from your containers. The importance of docker prune, and knowing how to improve resource usage by cleaning up the un
12 min read
What is Docker Build ?
Docker Build is one of the key features of Docker Engine, specifically designed to create container images. It plays an important role in the software development lifecycle by enabling developers to package applications and deploy them consistently across multiple environments. Docker Build isn't ju
12 min read
Docker Commands
Docker is an open-source project that automates the deployment of applications as movable, independent containers that can run locally or in the cloud. You can divide your applications from your infrastructure with the help of Docker, allowing for quick software delivery and it also allows you to ma
7 min read
What Is Docker Socket Binding ?
Docker has redefined the way developers work by creating a lightweight and portable platform for the containerization of applications. Among the key features of Docker is the capability to use the Docker daemon via the Unix socket called Docker socket. In Docker, Docker Socket Binding is a key conce
6 min read