# Elastic/elasticsearch-docker not assigning permissions to data directory on run

**URL:** <https://discuss.elastic.co/t/elastic-elasticsearch-docker-not-assigning-permissions-to-data-directory-on-run/65812>\
**Category:** Elasticsearch\
**Created:** [November 11, 2016, 1:49pm UTC](https://discuss.elastic.co/t/elastic-elasticsearch-docker-not-assigning-permissions-to-data-directory-on-run/65812 "2016-11-11T13:49:53Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![dliappis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dliappis/32/56174_2.png) [@dliappis](https://discuss.elastic.co/u/dliappis)\
**Post date:** [November 14, 2016, 2:34pm UTC](https://discuss.elastic.co/t/elastic-elasticsearch-docker-not-assigning-permissions-to-data-directory-on-run/65812/4 "2016-11-14T14:34:58Z")

</div>

> [@skubi](#):
>
> Yes, I did pay attention that you do recommend using the named volumes. The thing is that I am using external disk for storing the data due to the cloud limitations on boot drive. In my case /data directory is a mounted drive location.
> 
> If I am not mistaken and correct me if I am wrong but you cannot define location for named volume with local driver in Docker.

You **can** use a bind-mount for your specific use case, just ensure that the directory has such permissions that the elasticsearch user can write in it. Either tune your host OS mount parameters to ensure the external dir is writable when bind-mounted inside the container by the elasticsearch user or just create a subdir inside this external mount point owned by `1000:1000` using that instead.

In the Docker issue that you linked there is also mention of a method to create a named volume reflecting a host dir [https://github.com/docker/docker/issues/19990#issuecomment-248955005](https://github.com/docker/docker/issues/19990#issuecomment-248955005), but, as in the case of a bind-mount, the files will also retain the uid:gid and permissions of your host dir, so you'll need to address that.

Finally since you mentioned cloud usage, depending on the vendor, you may consider an alternative storage driver: a few open source projects include [GitHub - rexray/rexray: REX-Ray is a container storage orchestration engine enabling persistence for cloud native workloads](https://github.com/codedellemc/rexray) and [KING138 ## Situs Penyedia Pragmatic Play PG Soft dan No Limit City Terlengkap](https://clusterhq.com/flocker/introduction/).

---

_[View the full topic](https://discuss.elastic.co/t/elastic-elasticsearch-docker-not-assigning-permissions-to-data-directory-on-run/65812)._
