Getting a "Your data directory is readable by other users" error

Full error is:

Error
Your data directory is readable by other users
Please change the permissions to 0770 so that the directory cannot be listed by other users.

I’m running this on a freeNAS so I did move the default data directory and edited config.php file to reflect that: ‘datadirectory’ => ‘/usr/local/www/nextcloud/nextcloud_data’. It seemed like it was working fine, till I tried logging back in and got that error.

EDIT: Most are saying to edit fstab file. Again I want to reiterate I’m on FreeNAS, not sure if that would mess up my system so I’m hesitant to try. The current jails /etc/fbtab file is

root@NextCloud:/etc # cat fbtab
# $FreeBSD: releng/11.3/etc/fbtab 51237 1999-09-13 17:09:08Z peter $
#
#/dev/ttyv0     0600    /dev/console
#/dev/ttyv0     0600    /dev/pcaudio:/dev/pcaudioctl

The error is pretty self-explanatory. Users other that the web server user can read the directory.

If you’re using a FreeNAS data set, you may be able to set the ACL through the GUI.

I was under the impression I had to give user ‘www’ permission over that dataset. Do I have to remove access for everyone else?

EDIT: also it was working just fine from the get go. But as soon as I added a new user on NextCloud GUI and logged out it threw that error. Issue I think is that if I have to remove all but “www” user from the ACL for that dataset. I only have the one dataset and it has all my data like plex stuff, audiobooks, lectures etc.

Yes… that’s exactly what the error says.

Sounds like you need another dataset. Can you not create a vvol under it that has different permissions? You could also create a share with the correct permissions, run Nextcloud on a VM, and mount the share for the data directory.

Ahhh I didn’t realize you could just create another dataset nested underneath the existing. haha sorry I’m a network not a server guy by trade. Thanks for your help that got it to work.