# ES\_TMPDIR not setting all temporary files

**URL:** <https://discuss.elastic.co/t/es-tmpdir-not-setting-all-temporary-files/324019>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [January 26, 2023, 11:28am UTC](https://discuss.elastic.co/t/es-tmpdir-not-setting-all-temporary-files/324019 "2023-01-26T11:28:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lquenti](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lquenti/32/116424_2.png) [@lquenti](https://discuss.elastic.co/u/lquenti)\
**Post date:** [January 26, 2023, 11:28am UTC](https://discuss.elastic.co/t/es-tmpdir-not-setting-all-temporary-files/324019/1 "2023-01-26T11:28:29Z")

</div>

Hi all,

I am currently trying to set up elasticsearch with a read-only config directory within a docker based on the elasticsearch image. After thoroughly reading the docs, the only related Option I found was the `ES_TMPDIR` environment variable. I know that the environment variable is accepted elasticsearch since it crashes whenever I set it to something it is not allowed to write to.

Sadly, ES\_TMPDIR does not capture the

```auto
/usr/share/elasticsearch/config/elasticsearch.keystore.tmp

```

This means that the container crashes with a

```auto
java.nio.file.FileSystemException: /usr/share/elasticsearch/config/elasticsearch.keystore.tmp: Read-only file system

```

This is true, but is there any way I can configure elasticsearch to use another path for _all_ temporary files? I'd love to put it on `/dev/shm`.

Thanks in advance, don't hesitate to tell me how I can further provide help or can research on my own. I am just currently pretty lost.

Best Regards  
Lars

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [January 26, 2023, 12:00pm UTC](https://discuss.elastic.co/t/es-tmpdir-not-setting-all-temporary-files/324019/2 "2023-01-26T12:00:42Z")

</div>

Hi @lquenti and welcome!

This error indicates that Elasticsearch needs to adjust the keystore contents, which means it needs write access to the config directory. It can't use a temporary directory for this. If you do not want Elasticsearch to have write access to its config directory then you must manually make these adjustments to the keystore yourself before running Elasticsearch, [using the `elasticsearch-keystore` command](https://www.elastic.co/guide/en/elasticsearch/reference/current/elasticsearch-keystore.html).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 23, 2023, 12:01pm UTC](https://discuss.elastic.co/t/es-tmpdir-not-setting-all-temporary-files/324019/3 "2023-02-23T12:01:16Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
