Best way to map synology volumes into nextcloud

Nextcloud version: 26.0.1
Operating system and version: docker
PHP version: 8.1.18

Hi, I have set up nextcloud using docker-compose on a Synology DS220+ NAS.
On the NAS, there are two users, let’s call them A and B.
They have user volumes (i.e. folders) /volume1/folder_a, /volume1/folder_b and a shared folder /volume1/folder_ab.

Ideally, the users main folders would at the same time be their file roots which are currently created by nextcloud under /volume1/docker/nextcloud/data/USER/files.
I am looking for the best approach to do that or achieve something similar.

My approaches so far:

  1. Directly mapping the folders into the container: This might work, but files will be written using the nextcloud user inside the docker container. Are there any other side effects?
  2. Publishing the folders as WebDAV and using nextcloud “External Storage” app to access them on localhost. The advantage would be that it gets the users right. But it feels like a detour since everything is mounted locally already.

Any other ideas?
User A should be able to access /volume1/folder_a and /volume1/folder_ab, while user B should be able to access /volume1/folder_b and /volume1/folder_ab

Hi @nerdture

Just mount the data folder and let Nextcloud manage the files and user folders. Users should not directly access their data in /nextcloud/data/USER/files anyways, neither thorough the Synology-UI, nor via SMB, FTP, SFTP etc, because Nextcloud won’t recognize any changes made directly on the file system level. They should use the Nextcloud WebUI, the Nextcloud WebDAV interface, the Nextcloud Mobile Apps or the Nextcloud Desktop Client instead.

You can install the app Groupfolders and use it to implement this exact concept directly in Nextcloud: https://apps.nextcloud.com/apps/groupfolders

Ok, can you help me understand why nextcloud needs to recognize changes to files?

See, nextcloud is not my primary application. I intend to use the folders primarily over SMB.
Nextcloud would be additional means to browse the files on mobile phones and to upload files from the phones.

Because it is not just a simple web frontend for existing file servers. It has its own user mangement and all files are referenced in a database. If you add or change files directly on filesystem level, you have to make Nextcloud aware of the changes via occ command, which is not feasible for daily use. However, you can mount existing storage volumes as a secondary Nextcloud storage via the “External Storage Support” app.

https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/external_storage_configuration_gui.html

Doesn’t Synology also offer mobile apps for remote access and automatic backup of files and photos from your phone, etc.? If you mainly want to work with your existing SMB shares, you may not need Nextcloud at all, but instead you could use the built-in features of the DSM software and the respective mobile apps.

Either way, if you want to use Nextcloud together with existing SMB shares, the External Storage app is the way to go.