Cleanup of old containers

My diskspace usage was always growing and I was wondering what was using all the diskspace.
It was not the database file (400MB) or the logfile (2MB).

I found that there were old container images lingering around. Cleanup of these old images saved me 24GB of diskspace.

I used portainer to cleanup these old images, but that’s not the idea.

Shouldn’t hassio cleanup these old container images?

I have the same issue and it has been bugging me for some time now. I have been manually doing docker image prune manually but this is not the solution. The system should be self managing/healing and requiring a techie to run it.

Supervisor does clean up after itself. But those are not addon images and you’re using portainer so you’re running unsupported and therefore all bets are off. Supervisor does not expect unsupported software (non-addon images and containers) to be present so it has no inherent handling for them

I may have a similar issue. Running out of space. df -h says disk is full, du says there is plenty of space left. Posted a question here:

docker system df says I have 23GB in images. How do I clean this up?
I am running HAOS on proxmox vm, nothing “unsupported”.
Can I just run docker system prune ? Will this break anything?

1 Like

I’m in the same situation, for years, and nobody said what is expected that we make to clean it. In the past I used portainer to clean old images, but now portainer is unsupported so I guess this wan’t the way to clean old images. So, What is expected the people must do to clean unused images of old versions of addons?

It should happen automatically on a healthy system, but the command ha su repair can be used.

3 Likes

i think it does…

/mnt/data/docker/overlay2 # docker system df
TYPE            TOTAL     ACTIVE    SIZE      RECLAIMABLE
Images          18        14        7.977GB   2.912GB (36%)
Containers      14        14        52.4MB    0B (0%)
Local Volumes   0         0         0B        0B
Build Cache     0         0         0B        0B

It’s just that some docker Container use way too much Space… and i have no clue which one. as the “Local Volumes” are shown as 0 on HAOS

/mnt/data/supervisor/addons/data # du -h -d 1 /mnt/data/docker | sort -hr | head -n 10
22.1G   /mnt/data/docker/overlay2
22.1G   /mnt/data/docker
46.4M   /mnt/data/docker/image
1.6M    /mnt/data/docker/containerd
796.0K  /mnt/data/docker/containers
132.0K  /mnt/data/docker/network
116.0K  /mnt/data/docker/buildkit
28.0K   /mnt/data/docker/volumes
16.0K   /mnt/data/docker/plugins
8.0K    /mnt/data/docker/tmp

at least the prune did nothing at all…

/mnt/data/docker/overlay2 # docker system prune
WARNING! This will remove:
  - all stopped containers
  - all networks not used by at least one container
  - all dangling images
  - unused build cache

Are you sure you want to continue? [y/N] y
Total reclaimed space: 0B

Edit: Correction! If you want to get rid of empty Volumes, you need this to add --volumes to prune!

docker system prune --volumes
/mnt/data/docker/overlay2 # du -h -d 1 /mnt/data/docker/overlay2 | sort -hr | head -n 10
14.1G   /mnt/data/docker/overlay2
2.3G    /mnt/data/docker/overlay2/ccbf8ec1c2b83706012e9a16083a75cbe21599b5ac49f3e8759a5bb44b8f6100
1.4G    /mnt/data/docker/overlay2/7b0110ea6beea7c13ad417d3d7fda80a202ac0f23352bf9e5f6ad85e34276523
1.4G    /mnt/data/docker/overlay2/5f33890497f1a1a134ab2a3a57db6acb34a7df861f5cc2a8a3ceb443f19bb40e
1015.7M /mnt/data/docker/overlay2/76a1390933bc7526ad38257b342aa0ca6f0cddedd97995c7e8343e2b809ee9bb
917.5M  /mnt/data/docker/overlay2/a41980376d0f863012689a5a02e7c47faf42baa7bcab705f6700a87714645d70
904.5M  /mnt/data/docker/overlay2/188565b2e5a5f99b2aa58c319ba0da4ec26a2619cb08833404d8c522b4ccef0c
612.8M  /mnt/data/docker/overlay2/a3934f2b13917f5e7326b2705ce7272e1eb087f7dbaf67c3b21c3bb4367f2ea6
517.4M  /mnt/data/docker/overlay2/1290282dcd7514eeac6e2589a2e4b97fef2355850db6a11907d41e55bbe2e290
426.5M  /mnt/data/docker/overlay2/2be6606bc38b847bf4a83add679030c7e65878bda31890a00965e82c253b30c8
/mnt/data/docker/overlay2 # 

this brought down the size from 22gb to 14gb

Edit: even -verbose doesn’t show more storage info:

/mnt/data/docker/overlay2 # docker system df -v
Images space usage:

REPOSITORY                                        TAG         IMAGE ID       CREATED         SIZE      SHARED SIZE   UNIQUE SIZE   CONTAINERS
ghcr.io/home-assistant/qemux86-64-homeassistant   2025.8.2    64478dee3905   43 hours ago    2.03GB    0B            2.028GB       1
ghcr.io/home-assistant/amd64-hassio-cli           2025.08.1   d25aa8d722c4   4 days ago      54.4MB    44.97MB       9.387MB       1
ghcr.io/home-assistant/amd64-hassio-dns           2025.08.0   c480c7db0f97   6 days ago      69.6MB    44.97MB       24.66MB       1
ghcr.io/home-assistant/amd64-hassio-multicast     2025.08.0   257a3bb07cf0   6 days ago      45.1MB    44.97MB       120.1kB       1
ghcr.io/home-assistant/amd64-hassio-audio         2025.08.0   99c24258d3ed   6 days ago      81.3MB    44.97MB       36.32MB       1
ghcr.io/home-assistant/amd64-hassio-supervisor    2025.08.1   1cbed2678902   10 days ago     418MB     44.97MB       373.4MB       1
homeassistant/amd64-addon-piper                   1.6.3       42169a177d8a   12 days ago     225MB     101.3MB       123.7MB       1
ghcr.io/esphome/esphome-hassio                    2025.7.5    c115daa35c52   12 days ago     592MB     74.83MB       517.1MB       1
ghcr.io/hassio-addons/ssh/amd64                   21.0.2      0d9bf25d66a9   6 weeks ago     327MB     8.309MB       318.2MB       1
homeassistant/amd64-addon-speech-to-phrase        1.4.1       a4152e3375f9   6 weeks ago     1GB       101.3MB       899.5MB       0
homeassistant/amd64-addon-whisper                 2.6.0       e1a39b7344fb   2 months ago    1.48GB    101.3MB       1.382GB       0
ghcr.io/hassio-addons/vscode/amd64                5.19.3      177791530998   3 months ago    970MB     74.83MB       895.2MB       1
ghcr.io/home-assistant/amd64-hassio-observer      2025.02.0   b22cb2cf1712   5 months ago    10.1MB    0B            10.06MB       1
ghcr.io/hassio-addons/influxdb/amd64              5.0.2       91167dbd8e7e   6 months ago    523MB     0B            522.7MB       1
ghcr.io/hassio-addons/glances/amd64               0.21.1      453b86cb1912   16 months ago   104MB     7.377MB       97.11MB       1
homeassistant/amd64-addon-openwakeword            1.10.0      d78403b2b81b   17 months ago   305MB     0B            305.1MB       0
homeassistant/amd64-addon-configurator            5.8.0       5b6b5dab6789   18 months ago   117MB     7.377MB       109.2MB       1
ghcr.io/hassio-addons/ubuntu-base                 9.0.2       8e5500cdd97f   20 months ago   96.7MB    0B            96.73MB       0

Containers space usage:

CONTAINER ID   IMAGE                                                      COMMAND               LOCAL VOLUMES   SIZE      CREATED          STATUS                 NAMES
b3542d4d2cec   ghcr.io/home-assistant/qemux86-64-homeassistant:2025.8.2   "/init"               0               49MB      13 minutes ago   Up 13 minutes          homeassistant
8c47cee74417   homeassistant/amd64-addon-configurator:5.8.0               "/init"               0               17.9kB    2 hours ago      Up 2 hours (healthy)   addon_core_configurator
ca1d2e56ed1e   homeassistant/amd64-addon-piper:1.6.3                      "/init"               0               17.6kB    2 hours ago      Up 2 hours (healthy)   addon_core_piper
5657db4995c2   ghcr.io/hassio-addons/influxdb/amd64:5.0.2                 "/init"               0               325kB     2 hours ago      Up 2 hours             addon_a0d7b954_influxdb
4ab2e4e044c0   ghcr.io/hassio-addons/glances/amd64:0.21.1                 "/run.sh"             0               15.1kB    2 hours ago      Up 2 hours             addon_a0d7b954_glances
460f4428396d   ghcr.io/hassio-addons/vscode/amd64:5.19.3                  "/init"               0               324kB     2 hours ago      Up 2 hours (healthy)   addon_a0d7b954_vscode
f6d3729bb7c0   ghcr.io/hassio-addons/ssh/amd64:21.0.2                     "/init"               0               163kB     2 hours ago      Up 2 hours             addon_a0d7b954_ssh
8970c5452280   ghcr.io/esphome/esphome-hassio:2025.7.5                    "/init"               0               2.43MB    2 hours ago      Up 2 hours             addon_5c53de3b_esphome
8c4ddf7a24a1   ghcr.io/home-assistant/amd64-hassio-multicast:2025.08.0    "/init"               0               13.7kB    2 hours ago      Up 2 hours             hassio_multicast
2ea21f8b26d8   ghcr.io/home-assistant/amd64-hassio-audio:2025.08.0        "/init"               0               17.2kB    2 hours ago      Up 2 hours             hassio_audio
479175c7c912   ghcr.io/home-assistant/amd64-hassio-dns:2025.08.0          "/init"               0               14.5kB    2 hours ago      Up 2 hours             hassio_dns
e0fd382de586   ghcr.io/home-assistant/amd64-hassio-cli:2025.08.1          "/init"               0               12.9kB    2 hours ago      Up 2 hours             hassio_cli
ea26909fb899   ghcr.io/home-assistant/amd64-hassio-supervisor:latest      "/init"               0               15.4kB    2 days ago       Up 2 hours             hassio_supervisor
024550f0d6de   ghcr.io/home-assistant/amd64-hassio-observer:2025.02.0     "/usr/bin/observer"   0               0B        4 months ago     Up 2 hours             hassio_observer

Local Volumes space usage:

VOLUME NAME   LINKS     SIZE

Build cache usage: 0B

CACHE ID   CACHE TYPE   SIZE      CREATED   LAST USED   USAGE     SHARED