Some links on this page are affiliate links: if you sign up through them, this site earns a commission at no extra cost to you. Prices and recommendations are not affected.
A backup that succeeds is not the same as a backup that is cheap. If you run restic from an ephemeral container, docker run --rm restic/restic backup ..., there is a good chance that every run reads and hashes every file you own, every time, and nothing in the output tells you. The job exits 0, the repository does not grow, and you only notice when the nightly window stops being a window.
The problem was described in a post by the author of a self-hosting tool on a 1.46 TiB photo library. We did not want to repeat a claim, so we reproduced it on a small repository and tested four setups. The short version: you need a fixed --host, and if two volumes share a path inside the container you also need --group-by. If you are still choosing where the repository should live, start with our backup storage comparison.
What we tested
One host, Docker 28.3.1, the restic/restic:latest image pulled on 29 November 2026 (restic 0.20.0). Two source volumes, A and B, each with 200 random files of 256 KiB, so 50 MiB per volume. A local repository, the volumes mounted read-only at /data inside the container, and restic backup /data --json with the summary line read for files_new, files_changed and files_unmodified.
Restic decides which files it can skip by finding a parent snapshot and comparing each file’s path, size and modification time against it. By default the parent is the latest snapshot in the same group, and the default group is host plus paths. Everything below follows from that rule.
The results
Each row is a sequence of runs against the same repository. “Files read again” means restic reported the file as new or changed, so it was hashed:
| Setup | Run by run (files re-read of 200) |
|---|---|
| Random container hostname, volume A | 200, 200, 200 |
--host lab, volume A | 200 (first run), then 0 |
--host lab, volumes A and B alternating, same path /data | 200, 200, 200, 200 |
--host lab --group-by host,paths,tags, A and B alternating | 200, 200 (first run of each), then 0, 0 |
Three things to read from this.
Random hostname: no run ever finds a parent. Docker sets the container hostname to the short container ID, so the three snapshots showed three different hosts. Every run re-read all 200 files. The repository did not grow, because deduplication still worked: data_added was 0 on the repeats. The cost is reading and hashing, not storage.
A fixed host fixes one volume. The first run after the change still reads everything, because no existing snapshot carries the new host name. From the second run, all 200 files were reported as unmodified.
Two volumes at one path need the grouping flag. With a fixed host but the default grouping, snapshots of volume A and volume B share host and path, so restic picked the other volume’s snapshot as the parent. It compared the files, found them different, and reported all 200 as changed, on every run. With --group-by host,paths,tags and a tag per volume, each volume found its own parent.
The fix
Pin the hostname and group by tags, with one tag per source:
docker run --rm \
-v /srv/data/app1:/data:ro \
-v /srv/restic/repo:/repo \
-e RESTIC_REPOSITORY=/repo \
-e RESTIC_PASSWORD_FILE=/run/pw \
-v /srv/restic/pw:/run/pw:ro \
restic/restic backup /data \
--tag app1 \
--host backup-box \
--group-by host,paths,tags
We also confirmed two equivalent ways to set the host, both of which gave 200 unmodified files on the next run: the environment variable RESTIC_HOST, and Docker’s own --hostname flag on the container. Pick one and keep it in the script, not in your head.
When we touched a single file and ran again, restic reported 1 changed and 199 unmodified, which is exactly what a healthy incremental backup should say.
Two traps in the fix
The first run after the change is a full read. Existing snapshots carry the old random hostnames, so none of them is a parent for backup-box. Plan for one slow night. Per the restic help text, --parent lets you name a parent snapshot by hand and --force forces a re-read; we did not need either.
Tags are now part of the identity. If you change a tag, or forget to pass it in one script, that run has no parent and reads everything once. Keep the flags in one wrapper script instead of in several cron lines.
What this does not tell you
- We did not reproduce the hour-and-a-half. The source post reports about 1.5 hours per job on 1.46 TiB. Our data is 50 MiB per volume. We also timed a 1 GiB volume of 4,096 files: 1.3 seconds without a parent against 1.0 second with one. That test ran on a memory-backed filesystem with a hot cache, so it proves nothing about disks. The gap is I/O, and it appears on large, cold data, which is where it hurts.
- We tested a local repository. We did not measure request counts or egress against object storage, so we make no claim about what the extra reads cost there.
- The source post used restic 0.19.1, we used 0.20.0. The behaviour matched. We did not test older versions.
- Volumes with different content at the same path and the same tag would still confuse the parent choice. One tag per source is the rule.
How to check your own setup
You do not need to wait for a slow night. List the snapshots grouped the way restic groups them:
restic snapshots --group-by host,paths,tags
If every snapshot of the same job shows a different host name, you are paying this tax. If two different sources appear under one group, you are in the second trap. After the fix, run the job twice and read the summary:
restic backup /data --tag app1 --host backup-box --group-by host,paths,tags --json | tail -n 1
On the second run files_new should be 0 and files_unmodified should be the number of files you have. The same habit helps with other defaults that look fine until you measure them, which is the theme of our Docker production gotchas.
FAQ
Does this make my repository bigger? No. In our runs the repeated full reads added 0 bytes, because restic deduplicates by content. You pay in reading and hashing time.
Does this only happen in Docker? It happens whenever the host name changes between runs: ephemeral containers, CI runners, or a machine that gets renamed. Docker makes it easy to hit because the default hostname is random.
Can I just use --host and skip --group-by?
Only if every source is mounted at a different path inside the container. If you mount several volumes at the same path, such as /data, you need the grouping flag as well.
Do I have to change my existing snapshots? No. Old snapshots stay valid and restorable. They are simply not used as parents for the new host name.
Is a restic container the right way to do this at all? It works, and it keeps the host clean. A restic binary on the host avoids the hostname problem entirely, but the same rule applies if the host is rebuilt and renamed.
What’s next
Backups that run fast are cheap to keep running every night, and they need a place to land. Match the repository to the size of your data and the way you restore.