# Next Cloud (docker) - "Cannot create or write into the data directory" eurror

**URL:** <https://help.nextcloud.com/t/next-cloud-docker-cannot-create-or-write-into-the-data-directory-eurror/176432>\
**Category:** ℹ️ Support\
**Tags:** docker, ubuntu, linuxserverio\
**Created:** [December 12, 2023, 1:22am UTC](https://help.nextcloud.com/t/next-cloud-docker-cannot-create-or-write-into-the-data-directory-eurror/176432 "2023-12-12T01:22:54Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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 12, 2023, 7:56pm UTC](https://help.nextcloud.com/t/next-cloud-docker-cannot-create-or-write-into-the-data-directory-eurror/176432/4 "2023-12-12T19:56:25Z")

</div>

hi @TurboC welcome to the community 🤝

and like always - [search](https://help.nextcloud.com/search) helps - lot of issues have been discussed already!

> [@TurboC](#):
>
> `"/media/usr/dati:/var/www/html/data/usr/files"`

this is not the right mount destination. From the [docs](https://github.com/nextcloud/docker#persistent-data) you see

> `/var/www/html/` folder where all Nextcloud data lives

you want to persist more than files only e.g. config is essential 😉

Nextcloud runs by default with user 33:33 I would recommend to assign this user and correct permissions (folders:750, files: 640) to all data mounted into NC container. Newer versions can run with a different UID but this requires more tweaking.

---

_[View the full topic](https://help.nextcloud.com/t/next-cloud-docker-cannot-create-or-write-into-the-data-directory-eurror/176432)._
