Make data accesible via Nextcloud and SMB

For e.g. a collection of videos I need them to be accessible via Nextcloud and SMB at the same time ans all changes should be synchronized. Samba is running on the same server as Nextcloud. Using Webdav instead of SMB is not an alternative for performance reasons.

I wthink it might be possible to use the SMB as external storage for Nextcloud and as I understand it Nextcloud should detect changes made by an SMB client. But I would prefer not to use external storage for stability and complexity reasons to keep the Nextcloud server installation as simple as possible.

So i was thinking if it would be possible to install a Nextcloud client on the server (Debian) and let it synchronize the data from a local directory with Nextcloud? The same directory would be accessible by SMB and I would expect changes made via SMB to be detected by the Nextcloud client as a local file changes. Of course this works only for one or at most a few users because each one would need an own Nextcloud client.

On other drawback would be that this takes twice the storage space (which I would prefer to avoid as it’s several TB), but I was thinking that storing both the SMB directory and the Nextcloud data on the same btrfs subvolume and periodically running a deduplication tool might solve this problem quite elegantly without being visible to Samba or Nextcloud.

Might this work as I imagine or is there a misconception?

Hello, there are a number of threads on this already. Short answer is no for mounting samba as your root data directory. But you can still mount samba and use your config to force all users to use it without issue for all file and folder work. Agreed on it being higher performing then webdav, plus an all around great idea.

Exactly, this is how Nextcloud works. Good news is samba is fully supported as external storage, which is not scary, but rather the default behavior for mounting locations. You can mount directories however you wish, and then direct all files and folder actions through Samba.

This will avoid any duplication or conflict issues. :heart:

1 Like

Thank you for the link you supplied. But there is a note “Due to limitations of linux based SMB servers, this feature only works reliably on Windows SMB servers.”. As I’m running my server with Debian that would mean this is not supported.

Also when searching for threads that cover SMB I found quite many mentioning general problems and even many failures after a system or Nextcloud update.

Is this combination (SMB on same Debian server that Nextcloud runs on) really supported? And if not, would my alternative approach have a chance of working, i.e. installing an additional Nextcloud client on the server?

Try it out and test for yourself.

Setting the post time to once every 5 days to encourage you to do research before you post again. Good luck!!! :heart: