Containers

Free up Docker disk space

Docker quietly fills your disk with old images, containers and build cache. Here's how to see it and clear it.

  1. See how much space Docker is using
    Terminal
    docker system df
  2. Clear the safe stuff
    Terminal
    docker system prune

    Removes stopped containers, unused networks, dangling images and build cache. Type y to confirm.

  3. Clear everything not in use (bigger clean)
    Terminal
    docker system prune -a --volumes

    Also removes every image not used by a running container, and unused volumes. Volumes can hold database data, so be sure first.

Check it worked

  1. See how much you freed
    Terminal
    docker system df
  1. See how much space Docker is using
    Terminal · Ubuntu / Debian
    docker system df
  2. Clear the safe stuff
    Terminal · Ubuntu / Debian
    docker system prune

    Removes stopped containers, unused networks, dangling images and build cache. Type y to confirm.

  3. Clear everything not in use (bigger clean)
    Terminal · Ubuntu / Debian
    docker system prune -a --volumes

    Also removes every image not used by a running container, and unused volumes. Volumes can hold database data, so be sure first.

Check it worked

  1. See how much you freed
    Terminal · Ubuntu / Debian
    docker system df
  1. See how much space Docker is using
    PowerShell
    docker system df
  2. Clear the safe stuff
    PowerShell
    docker system prune

    Removes stopped containers, unused networks, dangling images and build cache. Type y to confirm.

  3. Clear everything not in use (bigger clean)
    PowerShell
    docker system prune -a --volumes

    Also removes every image not used by a running container, and unused volumes. Volumes can hold database data, so be sure first.

Check it worked

  1. See how much you freed
    PowerShell
    docker system df