Skip to main content

How to stop a Docker container?

A container is stopped with the docker stop command.


1. View running containers

bash
docker ps

2. Stop the container

By name:

bash
docker stop CONTAINER_NAME

or by ID:

bash
docker stop CONTAINER_ID

3. Force stop (if the container is not responding)

bash
docker kill CONTAINER_NAME

stop sends a SIGTERM signal (graceful stop), while kill sends SIGKILL (instantly terminates the process).


Important point

After stopping, the container remains in the docker ps -a list, and it can be started again with:

bash
docker start CONTAINER_NAME

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.