Home / Alt manpages / docker-pause(1)

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

Pause a Docker Container Safely and Resume It Cleanly

You will pause one or more running Docker containers, verify that they are paused, and resume them with the matching docker unpause command. The pause operation suspends processes without stopping the container. Allow about ten minutes, plus time to check that the application can tolerate a short interruption.

This guide uses Docker CE CLI 29.8.1 on Linux. You need a reachable Docker daemon and permission to access its Unix socket. The account running the commands may need to be in the docker group or may need sudo, depending on the host's setup. Use the privilege level that already works for your normal Docker commands.

1. Confirm the command and choose the target

The installed command is an alias for docker container pause. Its only argument is one or more container names or IDs:

$ docker pause --help
Usage:  docker pause CONTAINER [CONTAINER...]

Pause all processes within one or more containers

Aliases:
  docker container pause, docker pause

List running containers before changing state. Check the name carefully; a short ID is easy to misread in a busy terminal:

$ docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Image}}'
NAMES              STATUS                 IMAGE
web-production     Up 2 hours             example/web:2026.09
worker-production  Up 2 hours             example/worker:2026.09

Checkpoint: write down the exact name or ID you intend to pause. Do not use a broad list generated by an unreviewed shell expansion. This command affects the processes inside the named containers and can interrupt requests, queues and health checks.

2. Check the maintenance boundary

Pause is a service-disrupting action, even though it is reversible. On Linux, Docker uses the freezer cgroup to suspend the container's processes. The processes do not continue to handle work while paused. Existing network connections may wait or time out, and an orchestrator or monitoring system may report the service as unhealthy.

Do not use pause as a replacement for a clean shutdown. Use docker stop when the application needs to receive its normal termination signal and release resources. Do not pause a stateful service merely to make a backup unless the backup procedure specifically requires that boundary and you have tested the recovery path.

No root shell is required by this operation itself. If your account cannot access the Docker socket, rerun the Docker command with the host's approved privilege method, for example sudo docker pause web-production. Treat access to the Docker daemon as highly privileged: anyone who can control it can usually control containers and mounts on the host.

3. Pause the selected container

Replace the example name with the name you checked in step 1:

$ docker pause web-production
web-production

A successful command prints the affected container name. The command does not print the processes inside it and does not create a snapshot. It changes runtime state only. Keep the terminal output and exit status as part of your maintenance record.

For more than one container, pass each reviewed name explicitly:

$ docker pause web-production worker-production
web-production
worker-production

Checkpoint: if Docker reports an error, stop and investigate before repeating the command. A missing name, a stopped container or a daemon access problem is different from a successful pause. Do not assume that an error means every requested container has the same state.

4. Verify the paused state

Use docker ps with the paused status filter to find paused containers:

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

For an exact check of one container, ask Docker for its state:

$ docker inspect --format '{{.Name}}: {{.State.Status}}' web-production
/web-production: paused

The container remains present, but commands that need processes to run will not behave normally. For example, an exec attempt against a paused container fails until it is unpaused. This is a useful safety signal: do not mistake a successful Docker API response for a working application.

5. Resume the container

When the maintenance work is complete, resume the same container with docker unpause:

$ docker unpause web-production
web-production
$ docker inspect --format '{{.Name}}: {{.State.Status}}' web-production
/web-production: running

The command resumes the suspended processes. It does not restart the container, replay missed application work, or guarantee that clients will reconnect. Check the service's own health endpoint, logs or queue metrics after resuming.

If you paused several containers, resume the reviewed set explicitly:

$ docker unpause web-production worker-production
web-production
worker-production

Recovery is normally just docker unpause. If the daemon or host has restarted, inspect the containers first instead of blindly issuing a command. A container that is stopped is not a paused container; start it only if that is part of your documented recovery procedure.

6. Handle the common traps

  • Pause is not stop. Pause suspends processes. Stop asks the application to terminate, then may force it to exit after a timeout.
  • Do not run an interactive command inside a paused container. Unpause it first, or use a separate diagnostic container if that is appropriate for the incident.
  • Do not rely on a name copied from an old deployment. Re-run docker ps immediately before the change, especially after a redeploy.
  • Do not leave a maintenance pause unattended. Record the start time, owner and intended resume point, then verify the state after resuming.
  • Do not add sudo by habit. Use it only when the Docker socket policy requires it, and review the security implications of granting daemon access.

Done means

  • The exact target container name or ID was checked immediately before the change.
  • The pause was treated as a service interruption, with an agreed maintenance boundary.
  • docker inspect or the paused filter confirmed the intended state.
  • The same container was resumed with docker unpause.
  • The container reports running and the application was checked after resuming.