# Windows - Elasticsearch starting with elasticsearch.keystore protected

**URL:** <https://discuss.elastic.co/t/windows-elasticsearch-starting-with-elasticsearch-keystore-protected/363911>\
**Category:** Elastic Search\
**Tags:** windows\
**Created:** [July 27, 2024, 6:16pm UTC](https://discuss.elastic.co/t/windows-elasticsearch-starting-with-elasticsearch-keystore-protected/363911 "2024-07-27T18:16:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jandres84](https://avatars.discourse-cdn.com/v4/letter/j/ac8455/32.png) [@Jandres84](https://discuss.elastic.co/u/Jandres84)\
**Post date:** [July 27, 2024, 6:16pm UTC](https://discuss.elastic.co/t/windows-elasticsearch-starting-with-elasticsearch-keystore-protected/363911/1 "2024-07-27T18:16:31Z")

</div>

I have elasticsearh installed on Windows Server 2016. I have activated the security and some passwords were vaulted in the elasticsearch.keystore file. Then I proceed to protect the keystore using the command elasticsearch-keystore passwd. When I want to start elasticsearch I got errors because it needs the password of the elasticsearch.keystore.  
I have searched in the documentation and I have no found a way to configure a Windows service that takes the password.

Some research shows options using environment variables or storing the password in a file but I think the idea is to protect this password and this can not be visible for everyone.

Please your help!

---

<div class="post-metadata">

**Author:** ![paulmuller](https://avatars.discourse-cdn.com/v4/letter/p/ed655f/32.png) [@paulmuller](https://discuss.elastic.co/u/paulmuller)\
**Post date:** [July 29, 2024, 2:28pm UTC](https://discuss.elastic.co/t/windows-elasticsearch-starting-with-elasticsearch-keystore-protected/363911/2 "2024-07-29T14:28:03Z")

</div>

Could it be that what they [documented for Debian](https://www.elastic.co/guide/en/elasticsearch/reference/current/starting-elasticsearch.html#start-es-deb-systemd) can be applied to Windows, too?

- Put the pwd into a file
- Restrict access to said file to those permitted _and Elasticsearch_
- Put the path to said file into the env variable `ES_KEYSTORE_PASSPHRASE_FILE`.

---

<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:** [August 26, 2024, 2:28pm UTC](https://discuss.elastic.co/t/windows-elasticsearch-starting-with-elasticsearch-keystore-protected/363911/3 "2024-08-26T14:28:16Z")

</div>

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