What is the difference between Running and Starting a Docker container?

Better Stack Team
Updated on April 14, 2023

In Docker, the difference between running and starting a container is as follows:

  • Running a container means that the container is already started and is currently executing its main process. This can be confirmed by using the command docker ps, which lists all running containers.
  • Starting a container means that the container is not running and needs to be started in order to execute its main process. This can be done using the command docker start <container_id>.

When you create a new container using the docker run command, it is automatically started and enters a running state. However, if you stop the container using the docker stop command, it enters a stopped state and needs to be started again using the docker start command.

It is also possible to start a container in a detached mode (i.e., in the background) using the -d option with the docker run command. This will start the container but will not attach the terminal to it. In this case, you can use the docker attach command to attach to the running container and interact with it.

Got an article suggestion? Let us know
Explore more
Licensed under CC-BY-NC-SA

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

We are hiring.

Software is our way of making the world a tiny bit better. We build tools for the makers of tomorrow.

Explore all positions →

Reliability is the
ultimate feature

Delightful observability tools that turn your logs & monitoring into a secret weapon for shipping better software faster.

Explore Better Stack