Docker and Kubernetes

List, stop and restart Docker containers

See which containers are running, then stop, start or restart one by name.

Fill these in once
  1. List running containers
    Terminal
    docker ps

    The NAMES column on the right is what you type in the next steps.

  2. List every container, stopped ones too
    Terminal
    docker ps -a
  3. Stop a container
    Terminal
    docker stop my-app
  4. Start a stopped container
    Terminal
    docker start my-app
  5. Restart a container
    Terminal
    docker restart my-app

Check it worked

  1. Check its status
    Terminal
    docker ps -a --filter "name=my-app"

    STATUS says Up when it's running and Exited when it's stopped.

  1. List running containers
    Terminal · Ubuntu / Debian
    docker ps

    The NAMES column on the right is what you type in the next steps.

  2. List every container, stopped ones too
    Terminal · Ubuntu / Debian
    docker ps -a
  3. Stop a container
    Terminal · Ubuntu / Debian
    docker stop my-app
  4. Start a stopped container
    Terminal · Ubuntu / Debian
    docker start my-app
  5. Restart a container
    Terminal · Ubuntu / Debian
    docker restart my-app

Check it worked

  1. Check its status
    Terminal · Ubuntu / Debian
    docker ps -a --filter "name=my-app"

    STATUS says Up when it's running and Exited when it's stopped.

  1. List running containers
    PowerShell
    docker ps

    The NAMES column on the right is what you type in the next steps.

  2. List every container, stopped ones too
    PowerShell
    docker ps -a
  3. Stop a container
    PowerShell
    docker stop my-app
  4. Start a stopped container
    PowerShell
    docker start my-app
  5. Restart a container
    PowerShell
    docker restart my-app

Check it worked

  1. Check its status
    PowerShell
    docker ps -a --filter "name=my-app"

    STATUS says Up when it's running and Exited when it's stopped.

New to container? I explain it in plain English on Layman Terms.