Local Storage via fstab SMB Mount

I just set up nextcloud on an Ubuntu 18.04 VM, and this if my first time using nextcloud so forgive me if I am missing something obvious.

I setup fstab to mount an SMB share, and that seems to be working correctly. I am forcing the ownership of the mounted files to my ubuntu user credentials and that is showing correctly as well via ssh. I can see the mounted files, it all looks to be ok (I used the same settings I use for a Plex VM I have, so theoretically the VM has access, the only difference is this box I actually set up ufw, Plex VM doesn’t, not sure how that could play in though). The data is mounted in /mnt/nextcloud_upload

When I go to the webUI and external storage under the Administration settings I add the folder name I want, external storage as local, auth none (only option, and makes sense), configuration /mnt/nextcloud_upload and available for I left blank for all users.

I just get a red box to the left of the line item. Not sure why it wouldn’t be working… Also, I do see a warning at the top saying smbclient is not installed, which is strange since I know it is as I just installed it, and I can clearly see my SMB mount point in putty.

Any ideas…?

Ok, I found this but I am not sure exactly how to set this up. I don’t have a clue what the webUI user credentials are, how do you determine that? Since I can’t chown a fstab mounted directory, what would I use in the fstab settings? I need a uid and gid as far as I know…

External Storage in Nextcloud mounts directly SMB (or S3 or Dropbox etc) shares on remote network computers or storages. You’ve mounted your SMB share in fstab and then you try to re-mount it via local SMB Samba Share in Nextcloud? Everything on a public Webserver?

Forget fstab, try to access your given SMB share directly in Nextcloud instead.

I didn’t try and mount it via SMB in the webui, I tried via local mount with a directory path: /mnt/nextcloud_upload which is the directory I have mounted to via fstab.

I was just point out that I can’t mount via SMB in the webui either as it doesn’t give me the option due to “smbclient not installed” error message. I am just not sure why this message is there since smbclient is in fact installed.

As far as which method I should use from a security standpoint, that I don’t know. I could create a specific SMB user group specifically for this data so even if this VM was compromised, the attacker would only have SMB ability to an extremely small and relatively unimportant portion of my data. What would be the best from s security standpoint? Let Ubtuntu manage the SMB mount or nextcloud webUI? I would have thought Ubuntu would be more secure as I have to imagine it’s harder to break into Ubuntu than it would be to break into nextcloud webui. But I am a huge noob, just trying to get my homelab working, so any advice would be great!

Anyone have any recommendations for this?

SMB
Here is the NC 13 SMB/CIFS documentation. Looks like the recommended libsmbclient-php is renamed for Ubuntu packaging as php-smbclient (per their Github page). In my limited experience, this has worked better in general than the native smbclient.

That doesn’t make it a technologically better or more secure solution, just one that Nextcloud is well configured to use. I’d recommend this over the local route if possible, for just this reason.

Local
If the SMB share is from another container physically on this host, then the local option might make more sense with some caveats; otherwise I’d only recommend this if Nextcloud can’t mount the share using the PHP packages above.
Set the fstab uid and gid to whatever www-data is on your system (on my Ubuntu 18.04, it’s 33 for each, according to /etc/passwd and /etc/group), and you can skip the chown altogether. It doesn’t look like much has changed in the docs, but assuming you’re using NC 13, this is the current documentation page for local external storage, if that helps any.

I will have to look into this. Seems like it could be my answer. Thanks!