There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

[Help] Backing up Nextcloud with Duplicati (Docker)

I would like to back up my nextcloud data using duplicati, but I absolutely can‘t figure out how to give Duplicati access to the Nextcloud volume. Both are running fine in separate Docker containers. I can’t figure out how to properly mount the volume, below is my current compose for duplicati. Do I need to mount the volume as source? Does it need to be declared or mapped separately?


<span style="color:#323232;">---
</span><span style="color:#323232;">version: "2.1"
</span><span style="color:#323232;">services:
</span><span style="color:#323232;">  duplicati:
</span><span style="color:#323232;">    image: lscr.io/linuxserver/duplicati:latest
</span><span style="color:#323232;">    container_name: duplicati
</span><span style="color:#323232;">    environment:
</span><span style="color:#323232;">      - PUID=1000
</span><span style="color:#323232;">      - PGID=1000
</span><span style="color:#323232;">      - TZ=XXX
</span><span style="color:#323232;">      - CLI_ARGS= #optional
</span><span style="color:#323232;">    volumes:
</span><span style="color:#323232;">      - /path/to/appdata/config:/config
</span><span style="color:#323232;">      - /path/to/backups:/backups
</span><span style="color:#323232;">      - /path/to/source:/var/lib/docker/volumes/073ac2751cd65ffd84750e578c38482905c3c7e4851a8cbb0bbbc5c33a285e84
</span><span style="color:#323232;">    ports:
</span><span style="color:#323232;">      - 8200:8200
</span><span style="color:#323232;">    restart: unless-stopped
</span>
7Sea_Sailor ,

Why are you mounting the volume with the file system path, instead of the volume name? You should be able to mount the volume normally by specifying it in the volume section, i.e.


<span style="color:#323232;">services:
</span><span style="color:#323232;">  duplicati:
</span><span style="color:#323232;">    volumes:
</span><span style="color:#323232;">      - nextcloud_data:ro
</span><span style="color:#323232;">
</span><span style="color:#323232;">volumes:
</span><span style="color:#323232;">  - nextcloud_data
</span><span style="color:#323232;">    - external: true
</span>

That should grant Duplicati read-only access to the entire volume without messing around with absolute file paths.

avnrt OP ,

Thanks, I didn’t fully understand the syntax before. I now see the volume in the duplicati GUI, but not its contents. When I just back up the entire volume, the backup size is basically zero (should be more like 800MB).

MangoPenguin ,
@MangoPenguin@lemmy.blahaj.zone avatar

You’ve got your path backwards, do:

/var/lib/docker/volumes:/source

And then access the data at /source in Duplicati.

avnrt OP ,

Thanks! A drop down chevron has appeared next to the “Source Data” folder in duplicati, but it is still empty, showing neither the volume, nor its contents. Any idea what else I can try/modify?

MangoPenguin ,
@MangoPenguin@lemmy.blahaj.zone avatar

Does it show the root / filesystem inside the container?

You may need to update the folder permissions on the Nextcloud volume to allow all users to read data.

avnrt OP ,

I do see the entire filesystem, and now also the volume, but can’t access it.

MangoPenguin ,
@MangoPenguin@lemmy.blahaj.zone avatar

I would suspect permissions, make sure the volume is set to allow all users to read from it

avnrt OP ,

Yeah really seems most likely. I’ll start poking around permissions, thanks

GlitzyArmrest ,
@GlitzyArmrest@lemmy.world avatar

You might try adding :rw after each of your volume paths, like this:


<span style="color:#323232;">volumes:
</span><span style="color:#323232;">      - /path/to/appdata/config:/config:rw
</span>

My honest suggestion would be to ditch Duplicati for Duplicacy. Duplicacy is one time payment, but it’s much more polished than Duplicati. I actually had major issues with recovering files from Duplicati; sometimes it would work and sometimes it wouldn’t. Not ideal for something as critical as backup software.

skilltheamps ,

But it should not need write access to those files.

I bet it is due to different UID. Nextcloud runs with the www-data user, and UID 1000 is likely whatever user OP set up on the host machine. Make Duplicati run with the same UID as nextcloud and it will have the permission to read the files.

GlitzyArmrest ,
@GlitzyArmrest@lemmy.world avatar

You are probably correct! I always forget about the UID…

redcalcium ,

IIRC nextcloud docker image uses UID 33 instead of 1000.

__init__ ,

I just went through dockerizing my nextcloud installation. The www-data user on my host had uid 33, but the one inside the container uses uid 82, which had me scratching my head for a minute. You can confirm the actual uid by running id www-data inside the nextcloud container.

redcalcium , (edited )

I have two instances on two separate servers running and all of them use uid:gid 33:33 inside the container. I use the nextcloud:26-apache docker image.

Edit: I think your container image is based on Alpine linux, which use uid 82 for its www-data user. Try switching to a debian-based image (e.g. the apache version) if you want it to match with your host system.

__init__ ,

Ah yep I bet that’s it, I’m using the alpine fpm image.

avnrt OP ,

I’ll take a look at Duplicacy, thanks

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines