When you update Docker Compose stacks, the job should take one click per stack, not one per container, and it shouldn’t leave gigabytes of old images behind. Stashboard 5.4 added Update project, which pulls and recreates a whole Compose project at once, and 5.5 added a Storage panel and a scheduled docker image prune to reclaim the disk afterwards. This guide shows how the grouping works, what each update path really runs, what a prune removes and what it never touches. 🧹
If you haven’t updated a single container from Stashboard yet, read the one-click Docker container update guide first. The single-service Compose path is covered in the Compose-aware update guide, and this guide builds on both.
How Stashboard Groups Containers by Compose Project
Every container started by docker compose up carries a com.docker.compose.project label. The Docker page reads that label and puts each host’s containers into collapsible project groups. That grouping is the base of every bulk update:
- One group per Compose project. Since 7.1.1 even a single-container project gets its own group, because it still has project actions.
- Other containers is the last group, for anything started with
docker runor another tool that sets no Compose label. - The group header shows the project name, the container count and a status line: no tracked watches, N updates or up to date.
The counter only counts containers tracked by a watch, so untracked services never add to N updates. The Docker update monitoring guide explains watches.
The ⋮ button on the header opens the project menu. It holds Compose (the file viewer and editor, hidden on TCP+TLS connections) and Update project, which is the bulk action this guide is about.
Prerequisites
Before you first update Docker Compose stacks this way, check that you have:
- Stashboard 7.1.1 or newer. This guide was checked against 10.6.
- A Docker connection with a writable socket. The
:rosocket mount only allows tracking, not updates. - For the Compose path: a Local socket connection, your stacks directory bind-mounted into the Stashboard container, and the
docker composeCLI, which the official image already includes. - Watches with registry credentials for any private images, unless the host can already pull them.
- A fresh backup of the stack’s volumes, if the stack includes a database.
Step 1 — Check Which Update Path Your Stack Will Take 🔀
Update project has two ways to update a stack, and the connection picks one, not you:
- Compose path. On a Local socket connection whose containers’
com.docker.compose.project.working_dirlabel resolves to a directory inside the Stashboard container, Stashboard runs onedocker compose pulland onedocker compose up -din that directory. Compose reads the file andenv_filefrom disk and handlesdepends_onordering itself. Services whose image and config didn’t change keep running. - Raw path. For anything else, including every SSH and TCP+TLS connection, Stashboard updates each container through the Docker API. It orders them by the
com.docker.compose.depends_onlabel, then pulls, stops, removes, recreates and starts each one, waiting up to 30 seconds for its health check.
The raw path works from the container’s live settings, not your YAML. The SSH and TLS connection guide lists what each connection type supports.
To get the Compose path on a Local socket, mount the stacks root at the same path on both sides:
services:
stashboard:
image: vahac/stashboard:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /opt/stacks:/opt/stacks
If the paths differ, fill in Compose path mapping on the connection form with a host prefix and a container prefix.
⚠️ The raw path recreates every service, even ones with no new image. On an SSH or TCP+TLS host, a project update always restarts the whole stack. Run it when a few minutes of downtime is acceptable.
Step 2 — Confirm the Project Members on the Docker Host 🔍
Before you update Docker Compose stacks, check what Stashboard will treat as “the project”. It matches every container on that connection whose project label equals the group name, running or stopped. On the host:
docker ps -a --filter label=com.docker.compose.project=nextcloud \
--format 'table {{.Names}}\t{{.Image}}\t{{.Status}}'
Then check the working directory the Compose path will use:
docker inspect nextcloud-app-1 \
--format '{{ index .Config.Labels "com.docker.compose.project.working_dir" }}'
If that prints /opt/stacks/nextcloud, the same path must exist inside the Stashboard container.
⚠️ Stopped services are part of the project. Both paths start them again during a project update: up -d brings up every service in the file, and the raw path starts every container it recreates. If you stopped a service on purpose, remove it or move it to a Compose profile first.
Step 3 — Run Update Project and Read the Results ▶️
Open Docker, find the project group, click ⋮ and choose Update project to start the run. A three-phase dialog opens:
- Confirm lists each service with its image and a count such as “3 services · 2 tracked by a watch”. Untracked services show untracked — anonymous pull only: without a watch, Stashboard has no credentials for that image.
- Running shows a spinner on every row while images are pulled and containers recreated. A big stack can take a minute or more.
- Done marks each row Updated or Failed, with the real error printed on the failed row.
Read every row before you close the dialog. On the raw path, one failed service doesn’t stop the rest of the run.
⚠️ Clear the search box and the Running/Stopped filter first. The confirm list shows only the containers currently visible in the group, but the backend updates every container in the project. A filtered view makes the dialog under-report what’s about to restart.
If the project contains Stashboard itself, the update runs in a separate helper container, the rows show Scheduled, and the UI goes away while it restarts. Refresh after a minute.
After the run, Stashboard re-checks each tracked watch whose service updated, so the N updates counter clears without a manual Check now.
Step 4 — See What the Update Left Behind 🗂️
Every update that pulls a new image under the same tag leaves the old image behind, untagged as <none>:<none>. Docker calls that a dangling image. Once no container uses it, it’s pure waste, and weekly updates pile these up fast.
Each host card on the Docker page has a Storage row. In the default Collapsed style it’s one line, for example “42 images · 7 dangling (3.1 GiB) · 12 unused (5.4 GiB)”. Click it to expand four figures:
- Total: every image on the host.
- Dangling: images with no tag left.
- Unused: images no container references, running or stopped, including unused dangling ones.
- Last prune: the last successful prune on this connection.
Click Total, Dangling or Unused to list those images with tag, short ID, date, size and a dangling, unused or in use badge. The Storage switch at the top of the page picks Collapsed or Panel.
Step 5 — Prune Dangling Images Safely 🧽
Click Prune on the Storage row. The Prune images? dialog is a dry-run preview: nothing is deleted until you click Prune now.
- Will remove lists every image the prune will delete and the approximate size. By default that means dangling images that no container uses.
- Also prune unused images widens the scope to every image with no container, tagged or not. This is the equivalent of
docker image prune -a. - Can’t be removed appears when a dangling image is still held by a container, and it names that container.
Click Prune now and the dialog reports “Removed N images — freed X”. This cleanup only touches images. Volumes, networks, stopped containers and the build cache stay as they are.
⚠️ A prune can’t be undone. A deleted image comes back only by pulling it again, and a moving tag may pull a newer version than the one you deleted. Leave Also prune unused images off unless you’ve read the list.
⚠️ Docker never deletes an image a container still uses, even a stopped one. If a dead container holds an old image, remove the container first, then prune.
Step 6 — Schedule the Cleanup ⏰
Manual pruning is easy to forget, so the scheduled sweep finishes each update cycle for you. Open Settings → Image cleanup in the Docker group:
- Enable the scheduled image prune is the master switch, and it’s on by default.
- Interval (hours) defaults to 168 (weekly), with a minimum of 1 hour.
Then open each host’s ⋮ → Edit on the Docker page:
- Participate in scheduled image prune is on by default. Turn it off to leave that host out.
- Also prune unused images (aggressive) is off by default. It sets the sweep’s scope and pre-ticks the manual dialog’s checkbox, which you can still change per run.
The sweep checks every 30 minutes whether a connection is due. A new connection’s first scheduled prune runs one full interval after you add it, not right away. A host that can’t be reached isn’t marked as pruned, so the next pass tries again. The Prune now button works whatever these switches say.
How to Verify the Update and the Prune ✅
Check a project update in three places:
- Audit → Update attempts. Every run writes a parent row named
compose:<project>plus one row per service, with status, image, completion time and a ✓ in Health when the container passed its health check. - The Docker page. The group should read up to date once every tracked service is current.
- The host. Run
docker compose psin the project directory, ordocker pswith the label filter from Step 2, and check that every service isUpand, where it has a health check,(healthy).
The dialog doesn’t say which path a run took. On the raw path every container restarts, so every Up time resets. On the Compose path only changed services restart. The API response also has a mode field (Compose or Recreate) that you can see in the browser’s developer tools.
For the prune, open Audit → Image prune. Each run shows trigger, scope (Dangling only or Dangling + unused), status, images deleted and bytes reclaimed. On the host, compare before and after:
docker images --filter dangling=true
docker system df
The docker system df Images line should shrink by about the reclaimed amount.
Troubleshooting Project Updates 🔧
Most failed runs come down to one of these messages.
“Compose project directory ‘…’ was not found inside the container.” The Compose path couldn’t see the stack. Compare the working_dir label with the container’s mounts, fix the mount or the mapping, and run again. Nothing was recreated, so the old containers are still running.
A service fails with “Container reported ‘starting’ state after the project recreate.” On the Compose path, Stashboard inspects each container as soon as up -d returns, and a health check that hasn’t passed yet counts as a failure. If docker compose ps shows it healthy a minute later, the update worked. A depends_on with condition: service_healthy makes Compose wait for the dependency (startup order docs).
“Container started but did not become healthy within 30 s.” That’s the raw path’s health check timing out. The container is running, just slow. Check its logs from the container modal.
“docker pull failed” on an untracked service. A private image needs credentials. On the raw path, add a watch with registry credentials. On the Compose path, the Docker CLI inside the Stashboard container needs its own docker login for that registry.
The prune removed fewer images than “Dangling” shows. A container still uses those images. The dialog names it, so remove that container and prune again.
The result says more images than the preview, or frees less than promised. In 10.6 the count comes from Docker’s delete report, which lists untagged references and deleted layers separately. The preview adds up full image sizes, but shared layers aren’t freed. Trust docker system df and the Reclaimed column.
The weekly prune never ran. Check the master switch, the per-connection checkbox, and whether a full interval has passed since the connection was created.
Risks of Bulk Updates and Pruning ⚠️
Know these limits before you trust this routine with real data:
- Downtime for the whole stack. Every recreated service is briefly offline during a project update, and on the raw path that’s all of them.
- No rollback. If a service fails halfway, the others stay updated. A database migration that already ran won’t reverse, so back up volumes first.
- Floating tags jump versions.
latestorpostgreswithout a version can pull a new major release. Pin at least the major version on databases. - Credentials differ by path. The Compose path pulls with the login of the Docker CLI inside the Stashboard container, not the credentials saved on a watch.
- Aggressive pruning deletes rollback targets. Unused scope removes the previous tag you kept on purpose, and the images of any stack you’ve taken down with
compose down. - Pruning doesn’t touch everything. Volumes, build cache and logs can still fill the disk.
- The schedule is app-wide. One Settings → Image cleanup page drives the sweep for every user’s connections.
Update Docker Compose Stacks in Bulk: FAQ
Does Update project update containers that have no newer image?
On the Compose path, no. up -d only recreates services whose image or config changed. On the raw path, yes: every service is recreated, even with the same digest.
Why does Update project run per container on my SSH host?
In 10.6 the Compose path is only used on Local socket connections. SSH and TCP+TLS hosts always use the raw path, ordered by depends_on.
Is it safe to prune dangling images?
Yes, for the default scope, and it’s the right follow-up to every project update. A dangling image has no tag, and Docker skips any image a container still references.
Can I schedule Stashboard to update Docker Compose stacks?
No. In 10.6 Update project is manual. Stashboard checks watches for updates on a schedule but never applies them itself, and only the image prune runs on a timer.
Will image prune delete my volumes or data?
No. Stashboard runs an image-only prune. Volume cleanup is deliberately left out.
How often should the scheduled prune run?
Weekly (168 hours) suits most homelabs. Choose daily if you update daily on a small disk.
Bottom Line
A good routine to update Docker Compose stacks is short: check the project group, clear the filters, click Update project, read every row, then prune what the update left behind. Use a Local socket with the stacks mounted if you want Compose to decide what actually changed. Keep the scheduled sweep on dangling-only, and turn on the unused scope only on hosts where you never roll back by tag. Once that habit sticks, keeping your stacks current costs you a few minutes a week. 🚀
New to Stashboard? Start with the homelab dashboard overview, and review the Docker basics post on images and volumes. Stashboard is open source: code on GitHub, image on Docker Hub.
