Nextcloud Userdata on NFS share

Nextcloud version (eg, 18.0.2): 18.0.4
Operating system and version (eg, Ubuntu 20.04): Diet-Pi (latest version) on Raspberry Pi 4

Hey there,

I have the following issue:

I want to install Nextcloud on my newly installed Diet-Pi. Because of the minimal storage (SD card), I want to set the Data-Directory on my Synology NAS.

So I mount the NFS share in /mnt/dietpi_userdata/nextcloud_data and installed Nextcloud, but here comes the problem: When I mount the NFS it automatically overwrite the permissions I set from www-data:www-data to root:root.

With these permissions, Nextcloud can not wright in the data directory.

I tried some things I found online (eg. use SMB or External Share or use symlink) but all “solutions” I tried don’t work for me.

Is there a good and secure way to get Nextcloud data directory on my NFS share?


EDIT 27.4.2020:
So I am now a bit less confused. I managed to change the owner and permissions of my mount point by changing the squash and the nfs version. But even now I can not install Nextcloud. The installer tells me it can not create or write in my data directory.

I must find a way to use my NAS as data directory because of the amount of storage. When there is another way (other than external storage app) than I am here for ideas.

which nfs version are you using?

do have a user www-data on your synology?
in case of nfs4: do you use the same “nfs domain” in both devices?

I don’t know the exact version but v4 is disabled now. So it must be an older version.

About the user I am not sure. In the user settings are only my admin an one other account of my wife.
Where can I find out if I have a user www-data?

if you use nfs v3 the user doesn’t matter.
that is to say the owner ship is represented by uid/gid (the number). if there is no user with a matching uid is present the number is displayed.

do you use an empty share on your synology or do you try to mount a folder in e.g. home?

can you create a dummy file with sudo -u www-data touch /mnt/dietpi_userdata/nextcloud_data/dummy.txt ?

I try to use an empty directory.

When I try the command for the dummy file it works.

Here is a screenshot of the error message on dietpi

Not exactly an answer to your question, but why don’t you install Nextcloud on a Synology VM?

Does your NAS support iSCSI? No such issue would exist because NC would have direct control of the remote storage.

@anon71540698 I used to but I thought my pi is much faster and so I have all of my services together.

@KarlF12 no it doesn’t have. My alternative is to uy an USB 3 raid enclosure an use this for the storage.

I believe the latest Pi is quad-core A72… What’s on your Synology?

Not much :smile:

Ouch. No wonder people have issues running NC on those.

I bought a used Dell PowerEdge R420 a while back for about what a home grade NAS costs. Dual 6-core CPUs, 96 GB RAM, PERC with 4x 500 GB disks, iDRAC Enterprise… I run VMware ESXi on it to run Nextcloud and a bunch of other stuff.

Hey Nilsacht,

It is doable for sure : I do it between my Linux docker host and my FreeNAS server. For you not using NFS v4 means you are surely using v3. For that, what what you need more now is to check for UIDs more than Usernames.

So here in my Linux, Nextcloud is running under UID 33. For that, I had to create a user with UID 33 in FreeNAS. I then created a dataset for Nextcloud and made that UID 33 account the owner of everything in that brand new and empty data set.

Then, I mounted is from my Linux from. As root, I changed UID to UID 33. I then tried to create a sub-folder in the mounted share, as well as creating files. Once successful, it showed that everything was in order for Nextcloud to do its job.

Good luck troubleshooting your setup,

Thanks for the replies. I got it running. Not exactly how I wanted to but I think it’s good enough.

I installed nextcloud on the pi, mounted the nas in an other directory and changed the data directory after the installation of nextcloud.

I test it now a few days and see if everything works fine. If so I’m done :laughing: