AIO borg back up to remote borg repository fails due to closed SSH tunnel

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 32.0.4
  • Operating system and version (e.g., Ubuntu 24.04):
    • Debian trixie running docker 29.2.0
  • Is this the first time you’ve seen this error? (Yes / No):
    • yes
  • When did this problem seem to first start?
    • since initial setup, backup never worked
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • AIO running on docker using compose file from documentation
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

I’ve configured a remote borg back up server on a second machine (VM running on Truenas server that is installed bare metal on separte HW) to push backups to. After configuring this repository and adding correct public keys the backup is started through the AIO interface.

After some time the backup failed due to SSH tunnel being closed by the remote host (see logs below).

Looking in the borg documentation they recommend setting the keep alive on server and client side (https://borgbackup.readthedocs.io/en/stable/usage/serve.html#ssh-configuration ). I think my issues are related to this not being setup properly but since back up is initiated from the backup container I don’t know how/where to modify this (and especially in a way that is persistent when that container image is being updated).

What would be the correct way to (reliably) back up to a remote machine (/remote borg repository)?

Bonus question: can I configure multiple remote borg repositories? (i.e. back up to local and offsite server to ensure 3-2-1 backup)?

I came across this post with the same issue but there is no solution posted there unfortunately.

Log entries

Backup log

2026-01-24T15:24:48.017196890Z Connection closed by remote host.
2026-01-24T15:24:48.109165381Z Deleting the failed backup archive...
2026-01-24T15:24:56.969236537Z Archive 20260124_142610-nextcloud-aio not found (1/1).
2026-01-24T15:24:57.028728710Z ------------------------------------------------------------------------------
2026-01-24T15:24:57.028777720Z                        Original size      Compressed size    Deduplicated size
2026-01-24T15:24:57.028795925Z Deleted data:                    0 B                  0 B                  0 B
2026-01-24T15:24:57.028809461Z All archives:                    0 B                  0 B             23.20 GB
2026-01-24T15:24:57.028821825Z 
2026-01-24T15:24:57.028898113Z                        Unique chunks         Total chunks
2026-01-24T15:24:57.028949910Z Chunk index:                   52889                58529
2026-01-24T15:24:57.028964821Z ------------------------------------------------------------------------------
2026-01-24T15:24:57.152067799Z Backup failed!
2026-01-24T15:24:57.152124161Z You might want to check the backup integrity via the AIO interface.
2026-01-24T15:24:57.152140553Z Deleting borg.config file so that you can choose a different location for the backup.