Home / Alt manpages / docker-container-pause(1)

  • docker-container-pause(1)
  • User command
  • linux

Pause Docker Containers Safely and Resume Them

You will pause one or more running Docker containers, check that Docker reports them as paused, and resume them with the matching command. Pausing suspends the processes in place, so it is useful for a short maintenance window or a controlled inspection when you want the container state preserved. Allow about ten minutes if you already know the container names. This guide uses Docker CE CLI 29.8.1 on Linux.

1. Check the client and the target

Pausing is a service-disrupting action. Existing processes in the selected containers stop making progress until you unpause them, so identify the exact container before you run the command. You need a Docker client connected to the intended daemon and permission to control it. That often means membership of the Docker group or an elevated Docker socket policy, but do not add sudo automatically. Use the same access method you use for ordinary Docker administration.

First confirm the client version and list containers with their names and states:

$ docker version --format '{{.Client.Version}}'
29.8.1
$ docker ps --format 'table {{.Names}}\t{{.Status}}'
NAMES              STATUS
api                Up 3 hours
worker             Up 3 hours

The names in this output are examples. Use a name or ID from your own daemon, not a name copied from a different host. The command help on this installation shows the syntax as docker container pause CONTAINER [CONTAINER...]. The shorter alias docker pause is also available, but the longer form makes the operation easier to recognise in a runbook.

Checkpoint: write down the exact target, such as worker, and confirm that it is the container whose work may safely stop. Do not select a database, queue consumer or production endpoint merely because it is the first result from docker ps.

2. Pause one container

Run the command with one container name or ID:

$ docker container pause worker
worker

A successful command prints the selected container name or identifier and returns status zero. Docker uses the Linux freezer cgroup for this operation. That differs from sending SIGSTOP: the process is suspended without being told that it was paused, and it cannot capture the pause or resume event itself.

Pause does not remove the container, rebuild its image, or edit its filesystem. It also does not create a checkpoint that can be restored on another host. It changes the runtime state of the existing container. Network configuration, mounts and container metadata remain in place, but applications inside the container cannot process new work while their processes are frozen.

Checkpoint: if the command fails, stop here. A non-zero status means you have not established a paused state. Check the exact spelling and ID, inspect the daemon context with docker context show, and read the error before trying a different privilege level.

3. Verify the paused state

Use Docker's container listing filter instead of guessing from the application. The paused status is a Docker state, and the status text can include a human-readable suffix such as (Paused):

$ docker ps --filter status=paused --format 'table {{.Names}}\t{{.Status}}'
NAMES              STATUS
worker             Up 3 hours (Paused)

An empty result means that no paused container is visible through the current daemon and filter. It does not prove that the command was successful. Re-run the check with the exact container:

$ docker inspect --format '{{.Name}} paused={{.State.Paused}} running={{.State.Running}}' worker
/worker paused=true running=true

Here, paused=true is the state to look for. running=true does not contradict it: the container has not exited, but its processes are suspended. This distinction is why docker ps can show an Up duration alongside (Paused).

4. Understand what you cannot do while paused

Do not treat a paused container as a stopped container. A paused container still exists and retains its runtime state, while its processes do not advance. Commands that need a live process may fail or wait. For example, Docker documents that docker exec cannot start a process in a paused container; unpause it first.

Logs already written by the container can still be read from the daemon's logging system, but no new application output should be expected until the processes resume. Health checks and queue consumers can also stop making progress. External systems may time out, retry work or mark the service unhealthy. Check those effects before pausing a container behind a load balancer or responsible for acknowledgements.

Pause is therefore a poor substitute for a planned shutdown. If the application needs to flush data, close connections or handle a termination signal, use the service's documented stop procedure instead. Never pause a container and then assume its in-memory writes have reached durable storage.

5. Pause several containers deliberately

The command accepts more than one target:

$ docker container pause api worker
api
worker

Review the complete list before pressing Enter. This is one operation with several service impacts, not a harmless way to save typing. If one target is invalid or cannot be paused, read the command's result and verify each named container separately. Do not infer that every target changed state from a partial-looking output.

For a group managed by Compose, use the Compose command for that project and its service selection rather than mixing unrelated container names. A broad pause can stop dependencies or monitoring processes that you did not intend to affect. Record the original running set so that the recovery step is limited to containers you deliberately paused.

6. Resume the container

There is no pause-specific data rollback. The undo operation is to unpause the same container:

$ docker container unpause worker
worker
$ docker inspect --format '{{.Name}} paused={{.State.Paused}} running={{.State.Running}}' worker
/worker paused=false running=true

Once resumed, the processes continue from their existing state. They may immediately handle queued work, run delayed timers or reconnect to dependencies. Watch the application logs and health checks after resuming, especially if the pause lasted longer than the application's normal timeout window.

If the container was stopped while you were investigating, unpause is not the recovery command because a stopped container is not paused. Check its state first:

$ docker inspect --format '{{.Name}} paused={{.State.Paused}} running={{.State.Running}} status={{.State.Status}}' worker
/worker paused=false running=false status=exited
$ docker container start worker
worker

Only use start when you have confirmed that the container is stopped and restarting its workload is safe. Starting a container can run its entrypoint again and has different application consequences from unpausing it.

7. Handle common failures

A missing-container error usually means the name belongs to another Docker context, the container was removed, or the name was mistyped. Run docker context show and docker ps -a before changing permissions. A permission error is different: it indicates that the client cannot control the selected daemon. Ask the host administrator to confirm the approved access method rather than exposing the Docker socket or adding broad privileges as a quick fix.

If pausing is unsupported by the platform, check the runtime and container type. The installed manual states that Linux uses the freezer cgroup and that only Hyper-V containers can be paused on Windows. A failed pause is not a reason to kill the container: that would change the workload's state and may lose in-memory work.

Done means

  • You checked the Docker client version and selected the intended daemon context.
  • You confirmed the exact container name or ID before making a service-disrupting change.
  • docker inspect showed paused=true while the container remained running.
  • You understood that processes, health checks and application work are suspended, not gracefully stopped.
  • You resumed the selected container with docker container unpause and verified paused=false.