# Nextcloud "data" directory permissions resetting to 770

**URL:** <https://help.nextcloud.com/t/nextcloud-data-directory-permissions-resetting-to-770/13849>\
**Category:** ℹ️ Support\
**Created:** [June 9, 2017, 3:59pm UTC](https://help.nextcloud.com/t/nextcloud-data-directory-permissions-resetting-to-770/13849 "2017-06-09T15:59:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![returntrip](https://help.nextcloud.com/letter_avatar/returntrip/32/6_22734026db12803ebb3e059622ac3534.png) [@returntrip](https://help.nextcloud.com/u/returntrip)\
**Post date:** [June 9, 2017, 3:59pm UTC](https://help.nextcloud.com/t/nextcloud-data-directory-permissions-resetting-to-770/13849/1 "2017-06-09T15:59:07Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![tflidd](https://help.nextcloud.com/letter_avatar/tflidd/32/6_22734026db12803ebb3e059622ac3534.png) [@tflidd](https://help.nextcloud.com/u/tflidd)\
**Post date:** [June 10, 2017, 9:35pm UTC](https://help.nextcloud.com/t/nextcloud-data-directory-permissions-resetting-to-770/13849/2 "2017-06-10T21:35:58Z")

</div>

Yes, I think it is set automatically to 770:

> <https://github.com/nextcloud/server/blob/1c2ccd220611a3c269c8122dcab8a3a6251053ef/lib/private/legacy/util.php#L968>

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).

---

<div class="post-metadata">

**Author:** ![returntrip](https://help.nextcloud.com/letter_avatar/returntrip/32/6_22734026db12803ebb3e059622ac3534.png) [@returntrip](https://help.nextcloud.com/u/returntrip)\
**Post date:** [June 10, 2017, 10:15pm UTC](https://help.nextcloud.com/t/nextcloud-data-directory-permissions-resetting-to-770/13849/3 "2017-06-10T22:15:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![uusijani](https://help.nextcloud.com/user_avatar/help.nextcloud.com/uusijani/32/666_2.png) [@uusijani](https://help.nextcloud.com/u/uusijani)\
**Post date:** [January 10, 2019, 11:47am UTC](https://help.nextcloud.com/t/nextcloud-data-directory-permissions-resetting-to-770/13849/4 "2019-01-10T11:47:51Z")

</div>

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](https://github.com/nextcloud/server/issues/3245#issuecomment-348466177) (and [backported down to NC12](https://docs.nextcloud.com/server/12/admin_manual/configuration_server/config_sample_php_parameters.html)), 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.

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 2, 2024, 1:56pm UTC](https://help.nextcloud.com/t/nextcloud-data-directory-permissions-resetting-to-770/13849/5 "2024-12-02T13:56:43Z")

</div>



---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 4, 2024, 1:32pm UTC](https://help.nextcloud.com/t/nextcloud-data-directory-permissions-resetting-to-770/13849/6 "2024-12-04T13:32:28Z")

</div>


