Looking for how to backup nextcloud + mariadb docker with duplicati also in docker

Hi.

I have a working nextcloud and mariadb docker install with the following compose:

  mariadb:
    image: ghcr.io/linuxserver/mariadb
    container_name: mariadb
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
      - MYSQL_DATABASE=${MYSQL_DATABASE}
      - MYSQL_USER=${MYSQL_USER}
      - MYSQL_PASSWORD=${CONTRASENA}
    volumes:
      - ${DOCKERSDIR}/mariadb/:/config
      - ${DOCKERSDIR}/mariadb/conf.d:/etc/mysql/conf.d
    ports:
      - 3306:3306
    restart: unless-stopped

  nextcloud:
    image: ghcr.io/linuxserver/nextcloud
    container_name: nube
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
    volumes:
      - ${DOCKERSDIR}/nextcloud/appdata:/config
      - ${DOCKERSDIR}/nextcloud/data:/data
    ports:
      - 2443:443
      - 280:80
    external_links:
      - mariadb:mariadb
    depends_on:
      - mariadb
    restart: always

And, I have also duplicati installed:

  duplicati:
    image: ghcr.io/linuxserver/duplicati
    container_name: duplicati
    environment:
      - PUID=0
      - PGID=0
      - TZ=${TZ}
    volumes:
      - ${DOCKERSDIR}/duplicati/config:/config
      - ${DOCKERSDIR}/duplicati/backups:/backups
      - ${DOCKERSDIR}:/source
    ports:
      - 8200:8200
    restart: unless-stopped

Everything I saw, it’s executing a script in the host (Raspberry) to generate the backup files but I didn’t find any guide for doing the same directly from duplicati.

I’m interested in backing up mainly server setup files (user data is not very important because I’m not using nextcloud as a backup) for a fast and easy recovery.

Anyone has an idea?

Sorry for my english and thank you in advance for your help.

That easy, you are already mapping dockerdir as source in duplicati, meaning that you can select nextcloud and mariadb config dir for source of your backups. you dont need anything else.
Just make sure that ${DOCKERSDIR} is same for duplicati and nextcloud+mariadb
In /source/mariadb and /source/nextcloud you already have what you need to make the backup
And the guide -
Create new backup in duplicati
Select backup destination - /backups
Select backup source - checkmarks on My Computer/source/nextcloud/appdata and My Computer/source/mariadb
Config time schedule
Config file size and other…
Done

Thank you.

I will do it the way you say.

What I found, in every script, they put the server in maintenance mode or they use nextcloud.export to generate all the files needed to backup. I suppose that it’s because they copy users data so they need to stop syncs.

I hope I don’t need to have to use the backup, but having one is a must. :sweat_smile:

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.