Installation method: Docker via TrueNAS community apps
Summary of the issue you are facing:
I’m trying to create an NFS share of my user files directory and mount it on my PC, rather than running the Nextcloud desktop app on a mounted HDD folder. That way I can take out my HDD and use it as an offsite backup server.
After creating the NFS share in TrueNAS and mounting it on my PC, I get a “You do not have the permissions necessary” error. The directory is owned by www-data, so I tried adding myself (on both the host and client systems) to the www-data group, but no change. I also tried opening it as root, but that didn’t fix it either.
I’m not really sure if logs or configs are germane to this, and it might be more of a TrueNAS issue, but I was hoping maybe someone here has done this before. I did try an NFS share with a folder owned by root and editable by all users, and that worked, but I figure I should try to do this without giving every user access to my Nextcloud.
Sorry, I don’t quite get it. How would mounting your Nextcloud data folder via NFS on your PC be useful as a backup? If you mount an NFS share of your Nextcloud data from your TrueNAS server on your PC, the data is still only stored on the TrueNAS server — you’ve just created another way to access it from your PC through that share. No data actually gets copied to the HDD where the share is mounted. You’d still need to use a backup tool, write a script, or manually copy your data to a hard drive connected to the computer where the NFS share is mounted.
A better approach would be to create proper backups of your data directly on your TrueNAS server. TrueNAS offers a variety of options for backing up your data — for example, to another server or computer via ZFS replication or rsync, to external drives, or even encrypted to various cloud storage providers using tools like rclone or restic.
Also, backing up the data folder alone will only give you a backup of your files. To have a proper backup of all your Nextcloud data — such as user accounts, settings, and the data/content of various apps like Calendar, Contacts, Talk, etc. — you also need to back up the database. In other words, the best approach is to back up all Docker volumes or bind mounts.
For details on how to do this specifically in TrueNAS, it’s probably best to ask in the TrueNAS forum.
Sorry, I don’t quite get it. How would mounting your Nextcloud data folder via NFS on your PC be useful as a backup?
Sorry for the confusion! My goal is to be able to access my Nextcloud files via Nautilus. My current way of doing this is to mount an HDD on my PC and sync it to Nextcloud using the desktop app. But if I were able to access it as an NFS share, I could take the HDD out of my PC and plug it into a Raspberry Pi at a family member’s house, where it will act as a backup.
In other words, the best approach is to back up all Docker volumes or bind mounts.
Okay.
For details on how to do this specifically in TrueNAS, it’s probably best to ask in the TrueNAS forum.
That was the first place I went, but I haven’t gotten any replies yet. I haven’t gotten any replies on a few questions lately, to be honest… Regardless, this seems like a general Linux issue (?) so I was hoping someone here might be able to help.
Ah, okay, but it’s probably still not a good idea. Three things:
You shouldn’t access the files on the server directly because Nextcloud won’t be aware of any changes you make to them. For normal interaction with your files, you should use either the web browser, the desktop or mobile clients, or connect or mount them via WebDAV to your computer: Accessing Nextcloud files using WebDAV — Nextcloud latest User Manual latest documentation
Regardless of how you connect to your Nextcloud server to work with your files, I’d recommend getting a second hard drive so you can do both local backups and and offsite backups.
Don’t use the Nextcloud desktiop client for your backups because synchronization is not a backup! If you accidentally delete a file or folder on one end, it will also be deleted on the other end(s), including what you thought was your “backup.”.