Getting Borg backups to work on Nextcloud without an intermediary step was way more painful than it should have been and largely came down either a missing step in the documentation or a bug. I'll file a bug later and report back but in the meantime if you're new to #nextcloud and pulling your hair out because your remote #borgbackup won't work, the fix is fairly simple. Once you create the remote borg repo you need to copy the config file from the borg repository to the data directory of your nextcloud-aio container. So the steps look like this:
export BORG_REPO=ssh://[email protected]/path/to/repo
export BORG_PASSPHRASE=whatever you like
borg init -e repokey-blake2
cp /path/to/repo/config /var/lib/docker/volumes/nextcloud_aio_mastercontainer/_data/data/borg.config
chown www-data:www-data /var/lib/docker/volumes/nextcloud_aio_mastercontainer/_data/data/borg.config
chmod 0770 /var/lib/docker/volumes/nextcloud_aio_mastercontainer/_data/data/borg.config
So following above, you're creating your repo on host zzz.zzz.zzz.zzz (replace this with the IP address of the target) and then once that's done you're copying the config file that gets created in the borg repo into the data directory for the Nextcloud Master Container. It looks like this maybe worked on older versions so my guess is this is a bug but anyway, there you go, this should fix the issue with your backups not working. They'll hopefully fix this at a later date.

