Nextcloud "data" directory permissions resetting to 770

Simple question. Does Nextcloud set the permissions for the data directory to 770 automatically, whenever the Apache service is re/started in Linux?
I had set my data dir permissions to 755 and as soon as I started the “httpd” service, the permissions reverted to 770.

Yes, I think it is set automatically to 770:

If you want to grant access for other users, it’s perhaps better to set the group permissions that this user can access it (depending on your setup, a chmod 750 would be better, e.g. if you use it for a backup process).

1 Like

Thanks for finding that out! I have worked around this by mounting the partition with “acl” and setting an ACL.

1 Like

Sorry for necromancing, but because Google seems to like this thread, I just thought I’d add a mention that a check_data_directory_permissions option for config.php has since been implemented (and backported down to NC12), and it allows the admin to turn off the automatic permissions reset (by assigning it false).

This is discouraged however, and ACLs or other means of managing access are still the better option where available.

2 Likes