• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to Pause and Resume Docker Containers

by admin

Question: How to Pause and Resume running containers on docker host?

This post will help to know about pausing and resuming any running containers on the Docker host.

Let’s first start the docker container “memory_test” on the docker host.

# docker start memory_test
memory_test

To stop the pause the docker container:

# docker pause memory_test
memory_test

Verify the state of docker container using “docker ps”:

# docker ps
CONTAINER ID     IMAGE       COMMAND                  CREATED            STATUS             PORTS      NAMES
e6c2db30aa3f mytd/httpd:v2 "/bin/sh -c '/usr/sb…"  15 minutes ago   Up 11 seconds (Paused)  80/tcp   memory_test

You can also try connecting to the container. It should give you below error:

# docker exec -it memory_test bash
Error response from daemon: Container memory_test is paused, unpause the container before exec <<<< container is paused , you can not connect .

Run the below command to resume or unpause the container.

# docker unpause memory_test

Verify the state of the docker container again.

# docker ps
CONTAINER ID     IMAGE         COMMAND                CREATED       STATUS            PORTS          NAMES
e6c2db30aa3f mytd/httpd:v2 "/bin/sh -c '/usr/sb…"  17 minutes ago  Up 2 minutes      80/tcp        memory_test

Now you can connect to container again via docker exec command .

# docker exec -it memory_test bash
bash-4.1# uname -a
Linux e6c2db30aa3f 4.14.35-1818.3.3.el7uek.x86_64 #2 SMP Mon Sep 24 14:45:01 PDT 2018 x86_64 x86_64 x86_64 GNU/Linux

The container is connected and commands also work fine inside containers.

Filed Under: DevOps, Docker

Some more articles you might also be interested in …

  1. A Beginner’s Guide To Create Files & Folders Inside Windows Subsystem For Linux
  2. Install AzCopy on Linux – Fastest way to copy in Azure
  3. “docker dead but subsys locked” – error while starting docker
  4. “docker ps” Command Examples
  5. ansible-playbook – Execute tasks defined in playbook on remote machines over SSH
  6. “docker machine” Command Examples
  7. ValueError: Masked arrays must be 1-D
  8. “docker rmi” Command Examples
  9. Understanding Variables in Bash Shell Under Linux
  10. kubectl: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright