How to fix Error response from daemon: Cannot pause container: Container is not running in Docker

DockerBEGINNERLOWUpdated Dec 6, 2025ยท 149 views

This error occurs when attempting to pause a Docker container that is not in the running state. You can only pause containers that are actively running - check the container status and start it first if needed.

Quick fix

Fixes Error response from daemon: Cannot pause container: Container is not running

docker ps -a
  1. Check the container status
  2. Start the container first
  3. Now pause the container
  4. Handle containers that keep exiting
docker โ€” error
docker ps -a
Error response from daemon: Cannot pause container: Container is not running

What this error means

This error occurs when you try to use the `docker pause` command on a container that is not currently running. The full error message reads: "Error response from daemon: Cannot pause container: Container is not running". The `docker pause` command uses the Linux cgroups freezer to suspend all processes inside a container. Since this mechanism freezes running processes in memory, it requires the container to actually be running. You cannot pause a container that is stopped, exited, or in any other non-running state. This is different from the `docker stop` command, which can be run on a running container to stop it. The pause operation specifically requires an active, running container with processes that can be frozen.

Typical symptoms

  • 'docker pause <container>' fails with 'Error response from daemon: Cannot pause container: Container is not running'
  • 'docker compose pause' fails for services that are not running
  • Attempting to pause a container that shows 'Exited' status
  • Scripts or automation that assume containers are running fail when trying to pause them

Common causes

  1. Container has already been stopped using 'docker stop'
  2. Container exited on its own due to the main process completing or crashing
  3. Container was never started after being created
  4. Container was removed and recreated but not started
  5. Docker Compose service is defined but not running

How to fix "Error response from daemon: Cannot pause container: Container is not running"

1Check the container status

First, verify the current state of your container:

bash
docker ps -a

Look for your container in the output. The STATUS column tells you the container's state:

bash
CONTAINER ID   IMAGE     STATUS                      NAMES
abc123def456   nginx     Exited (0) 5 minutes ago    my_container
def456ghi789   redis     Up 10 minutes               my_redis

A container showing "Exited" or "Created" cannot be paused - only containers showing "Up" can be paused.

You can also check a specific container:

bash
docker inspect <container_name_or_id> --format='{{.State.Status}}'

This returns the status: running, exited, created, paused, etc.

2Start the container first

If the container is stopped or exited, you need to start it before you can pause it:

bash
docker start <container_name_or_id>

Verify it's running:

bash
docker ps

The container should now show "Up" in the STATUS column.

3Now pause the container

Once the container is running, you can pause it:

bash
docker pause <container_name_or_id>

If successful, the command completes silently. Verify the pause worked:

bash
docker ps

The status should now show "Up X minutes (Paused)".

For Docker Compose:

bash
# Start services first if not running
docker compose up -d

# Then pause
docker compose pause <service_name>
4Handle containers that keep exiting

If your container keeps exiting and won't stay running, you need to fix the underlying issue before you can pause it:

bash
# Check container logs for errors
docker logs <container_name_or_id>

# Check exit code
docker inspect <container_name_or_id> --format='{{.State.ExitCode}}'

Common reasons containers exit immediately:
- The main process completes (container has nothing to do)
- The process crashes due to missing dependencies or configuration
- Missing environment variables or volumes

For containers that need to stay running for pause to work, ensure the main process doesn't exit. For example, use tail -f /dev/null as a command to keep a container alive if needed for testing.

Advanced notes

Understanding container states: Docker containers can be in several states, and only the "running" state allows pausing:

| State | Can Pause? | Description |
|-------|------------|-------------|
| created | No | Container created but never started |
| running | Yes | Container is active with processes |
| paused | No | Already paused |
| restarting | No | Container is restarting |
| exited | No | Container stopped (cleanly or with error) |
| dead | No | Container failed to stop properly |

Pause vs Stop decision tree:
- Use pause when you want to temporarily freeze a container and resume it quickly with all state preserved
- Use stop when you want to shut down the container and don't need to preserve in-memory state

Scripting considerations: When writing scripts that need to pause containers, always check the container state first:

bash
# Check if container is running before pausing
if [ "$(docker inspect -f '{{.State.Running}}' my_container 2>/dev/null)" = "true" ]; then
    docker pause my_container
else
    echo "Container is not running, cannot pause"
fi

Docker Compose behavior: The docker compose pause command only affects running services. Services that are not started will be silently skipped - no error is thrown, but they won't be paused either.

Alternative: Use stop instead: If you're trying to pause a container just to free up resources and don't need to preserve state, consider using docker stop instead, which works on running containers and doesn't require the container to be in a specific state beforehand.

Frequently asked questions

What does "Error response from daemon: Cannot pause container: Container is not r" mean?
This error occurs when you try to use the docker pause command on a container that is not currently running. The full error message reads: "Error response from daemon: Cannot pause container: Container is not running". The docker pause command uses the Linux cgroups freezer to suspend all processes inside a container.
How do I fix "Error response from daemon: Cannot pause container: Container is not r"?
This error occurs when attempting to pause a Docker container that is not in the running state. You can only pause containers that are actively running - check the container status and start it first if needed.
What causes "Error response from daemon: Cannot pause container: Container is not r"?
Container has already been stopped using 'docker stop' Container exited on its own due to the main process completing or crashing Container was never started after being created
Is the "Error response from daemon: Cannot pause container: Container is not r" error serious?
It is a low-severity error โ€” more of a blocker than a risk. The steps above resolve it.

Official resources & further reading