Adding directories from other hosts

Hi all,

Would there be a way to add additional directories for my selfhosted home network Nextcloud to use? I’m thinking of mounting an NFS share to my instance and then would love to have Nextcloud be able to browse that NFS share and have the files show up in the respective apps. Like images, mp3s, documents etc.

This NFS share is used across the network on other services, but it would be nice to be able to have Nextcloud use it as well. I don’t really want to make this the data directory, just an additional source. I may be able to use the External Storage app, but it does not seem to support NFS. Maybe if I mount the NFS share and set it local on the app?

Any thoughts on how to do this would be great!

I would not use it. But you can mount NFS on your Nextcloud and then use Local. Not tested.

What do you mean by saying you would not use it? Not try to add extra directories, or not use NFS? Sorry not clear on what you meant there.

Unfortunately, I tried this and the NFS permissions are nobody:nogroup instead of www-data:www-data. Pretty sure that makes it not usable, since Nextcloud has not access.

Yes, of course you have to assign it as www-data:www-data. Unfortunately, I’m not familiar with NFS. Hopefully there is an option for mount or fstab.

Why don’t I use it? I always find it error-prone. Changes made directly in the data can lead to problems in Nextcloud. Or with Nextcloud with the data in NFS. I would rather increase the amount of data in Nextcloud and do without NFS. Or, conversely, continue to use Nextcloud and NFS in parallel. If you share the data sensibly, this is usually the better solution than trying to create a system that seemingly implements all solutions.

Guess what I am looking for is to be able to use Nexcloud’s features while still being able to share media files with other services, like Jellyfin… I don’t really want to keep my media locked into Nextcloud but would like to have it accessibly by it.

Maybe it’s not possible…

I do not use NFS. But maybe you can use this. Sorry german. Seems not to be the best solution because of root_squash.

I’m no expert on NFS either, but I’d say the nobody:nogroup issue is probably solvable by disabling the root_squash functionality. However, that still wouldn’t solve the second problem, which is that www-data (UID33) probably doesn’t have permissions to access the files on the NFS share, because they are most likely owned by another UID. I suppose this could be solved with idmapping, but again, I’m no expert.

Another and probably easier way would be to share the folder via SMB and then mount it directly to Nextcloud via the SMB option in the External Storage application. This way you could mount the folder with the username of your user on the file server, respectively the user who actually owns the files in that folder.