# Elasticsearch files in tmp folder: how to change there location

**URL:** <https://discuss.elastic.co/t/elasticsearch-files-in-tmp-folder-how-to-change-there-location/289543>\
**Category:** Elasticsearch\
**Created:** [November 18, 2021, 8:11am UTC](https://discuss.elastic.co/t/elasticsearch-files-in-tmp-folder-how-to-change-there-location/289543 "2021-11-18T08:11:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![1ac727ff300829bca0fa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/1ac727ff300829bca0fa/32/89883_2.png) [@1ac727ff300829bca0fa](https://discuss.elastic.co/u/1ac727ff300829bca0fa)\
**Post date:** [November 18, 2021, 8:11am UTC](https://discuss.elastic.co/t/elasticsearch-files-in-tmp-folder-how-to-change-there-location/289543/1 "2021-11-18T08:11:33Z")

</div>

Hello guys,  
I have set up elk in linx server using tar, but my tmp directory gets filled with files in following formates

> /tmp/elasticsearch-17741669071348173933

How to change there location?

---

<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:** [November 18, 2021, 11:05am UTC](https://discuss.elastic.co/t/elasticsearch-files-in-tmp-folder-how-to-change-there-location/289543/2 "2021-11-18T11:05:46Z")

</div>

You can [control this with the `$ES_TMPDIR` environment variable](https://www.elastic.co/guide/en/elasticsearch/reference/current/important-settings.html#es-tmpdir).

---

<div class="post-metadata">

**Author:** ![1ac727ff300829bca0fa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/1ac727ff300829bca0fa/32/89883_2.png) [@1ac727ff300829bca0fa](https://discuss.elastic.co/u/1ac727ff300829bca0fa)\
**Post date:** [November 18, 2021, 11:26am UTC](https://discuss.elastic.co/t/elasticsearch-files-in-tmp-folder-how-to-change-there-location/289543/3 "2021-11-18T11:26:35Z")

</div>

> [@DavidTurner](#):
>
> control this with the `$ES_TMPDIR` environment variable

we set it like this right export ES\_TMDIR = /tmp/ES then restart es, right?

---

<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:** [November 18, 2021, 11:38am UTC](https://discuss.elastic.co/t/elasticsearch-files-in-tmp-folder-how-to-change-there-location/289543/4 "2021-11-18T11:38:11Z")

</div>

It'll be something like that. The exact details are more of a sysadmin question which will depend on your system - this isn't the best place to get help on that. As long as `$ES_TMPDIR` is set when Elasticsearch starts then it should be happy.

---

<div class="post-metadata">

**Author:** ![1ac727ff300829bca0fa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/1ac727ff300829bca0fa/32/89883_2.png) [@1ac727ff300829bca0fa](https://discuss.elastic.co/u/1ac727ff300829bca0fa)\
**Post date:** [November 19, 2021, 7:02am UTC](https://discuss.elastic.co/t/elasticsearch-files-in-tmp-folder-how-to-change-there-location/289543/5 "2021-11-19T07:02:16Z")

</div>

i did this even

> echo $ES\_TMPDIR  
> /tmp/ES

gives me this  
but still elasticsearch files are getting created in /tmp directory only

---

<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:** [December 17, 2021, 7:02am UTC](https://discuss.elastic.co/t/elasticsearch-files-in-tmp-folder-how-to-change-there-location/289543/6 "2021-12-17T07:02:56Z")

</div>

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