Back up to a NAS or NFS share
Nodvard Deck backs up its own data, encrypted and on a schedule. By default, the backups go to a folder inside the data folder. That protects against mistakes, but not against a broken SD card. A folder on another drive or a NAS is better. Here is how to set it up.
Before you start
Under Settings, System, Backup, first set a backup password (at least 12 characters). Deck then shows the recovery key once. Keep it safe: without the password and the key nobody can open the backups, not even you. That is also where you turn on automatic backups and choose how many backups to keep. The interface is in German for now.
Deck accepts only two targets: /app/data/backups inside the data folder, or the mounted folder /backups and its subfolders, such as /backups/deck. This always means the path inside the container, not the one on the host or the NAS.
- Mount the NAS folder on the machine that runs Deck, for example under
/srv/backup/deck. For NFS, as a line in/etc/fstab:/etc/fstabnas:/volume1/backup/deck /srv/backup/deck nfs defaults,_netdev,x-systemd.before=docker.service 0 0The NFS share must be mounted before Docker starts. Otherwise Docker mounts the empty folder on the local disk, and the backups end up there instead of on the NAS.
_netdevtells the system that it is a network drive,x-systemd.before=docker.servicemakes Docker wait for it. - Give the folder to the container. Under
volumes:,compose.ymlalready contains a prepared line. Remove the#in front of it and put in your path:compose.yml, under volumes:- /srv/backup/deck:/backupsThen run
docker compose up -din the same folder. In Portainer, edit the stack and click “Update the stack”. - Write access for user 1000. Inside the container, Deck runs as user and group 1000. The folder on the NAS must be writable for 1000. Either run
chown 1000:1000for the folder on the NAS, or map all access to 1000 in the NFS export:all_squash,anonuid=1000,anongid=1000.With NFS, a
chownon the host usually does nothing, because the NAS does not let root through (root_squash). - Test it before you save in the interface.
docker psshows the container name:In a terminaldocker exec -u 1000 <container> sh -c 'touch /backups/.test && rm /backups/.test && echo ok' - Choose it in the interface. If you get
ok, enter/backupsor a subfolder as the folder under Settings, System, Backup.
If you get a message when saving
The interface shows these messages in German. They mean:
The folder /backups does not exist (is it mounted?)
The line - …:/backups is missing or still commented out, or the container was not recreated afterwards. Run docker compose up -d, in Portainer “Update the stack”.
Backups may only be written to /app/data/backups or the mounted folder /backups
Enter the path inside the container, so /backups or /backups/…, not the path on the host such as /srv/backup/….
Nodvard Deck may not write to /backups
Write access for 1000 is missing (step 3), or the NFS share was not mounted yet when Docker started (step 1).
More
Everything about backing up Deck, also without a NAS and by hand, is in the guide in the repository. The community answers questions on Discord.