Skip to main content
⚡ OpenDevDocs
Docker
devopsdockerCore ConceptBeginner

Docker Container Lifecycle & States

Complete guide to container lifecycle states (created, running, paused, stopped, dead), transitions, and lifecycle commands.

Verified: 2026-09-30
Tested on:docker 27.x
Platforms:
linuxmacoswindows
#docker#lifecycle#containers#states#devops

A Docker container moves through well-defined lifecycle states from creation to destruction.


Container State Transition Diagram

                 docker create
   [ Image ] ─────────────────────► [ CREATED ]
                                        │
                                        │ docker start
                                        ▼
    docker pause                  [ RUNNING ] ◄───────────────────┐
 ┌─────────────── [ PAUSED ]            │                         │ docker restart
 │                    │                 │ docker stop (SIGTERM)   │
 │ docker unpause     │                 ▼                         │
 └────────────────────┴──────────► [ STOPPED / EXITED ] ──────────┘
                                        │
                                        │ docker rm
                                        ▼
                                  [ DESTROYED ]

Container Lifecycle Commands

CommandActionSignal Sent
docker createCreates writable container layer without starting PID 1None
docker startStarts an existing created or stopped containerNone
docker stopGracefully stops container (default 10s timeout before kill)SIGTERM $\rightarrow$ SIGKILL
docker restartStops and starts containerSIGTERM $\rightarrow$ SIGKILL $\rightarrow$ Start
docker pauseFreezes container processes using cgroups freezerSIGSTOP
docker unpauseUnfreezes container processesSIGCONT
docker killImmediately terminates container processSIGKILL
docker rmDeletes stopped container and its writable layerNone

Cleaning Up Containers

# Stop all running containers
docker stop $(docker ps -q)

# Remove all stopped containers
docker rm $(docker ps -a -q)

# Prune all stopped containers in one step
docker container prune -f

On this page