Automatic Nextcloud backup on Synology NAS

Hey guys,

I’m using Nextcloud on my v-server. I also ordered a Synology NAS to store my backups and other data. Of course i want to backup my Nextcloud on the NAS, too.

Does anyone have a hint how I get an automatic backup (at night) of my nextcloud on the v-server to my NAS?

It would be glad if someone can help, because I’m really new to the topic of network/server…

Thanks a lot!


Here, I do it with FreeNAS but you surely can do the same from another NAS. Just put Nextcloud data path directly on the NAS :
–Create a dataset in the NAS for Nextcloud and give ownership to your nextcloud user like www-data
–Share it over NFS (sqash all user access to the uid you use for web / nextcloud like www-data)
–Mount it from the Nextcloud (be sure to put it in /etc/fstab to have it mounted at boot)
–Configure Nextcloud to use it for datastorage
–Configure snapshots in the NAS to take your backups

Should you wish more than snapshots, create another dataset and use your favorite backup tool to save its backup on that second dataset.

Good luck,


Thank you for your help, but how can I configure Nextcloud to use it for datastorage?

The setting is under your nextcloud root directory, in config/config.php
The variable you need to set is datadirectory

Mount your NAS in a directory of your choice, like /mnt/nfs and point the variable to that path.


Okay I get an error message while I’m trying to mount:

mount.nfs: No such device

My command:
mount /var/www/vhosts/ -> IP of my Synology NAS
/volume1/NextcloudBackups -> Path of the dataset
/var/www/vhosts/ -> datastorage path like in config.php

Any ideas what I can do? Before trying to mount, I installed nfs-common on my server.


Is the nfs client really installed in your system ?

apt-get install nfs-common

mount -t nfs /var/www/vhosts/

Remembers that everything is case sensitive…