# How to setup a basic authentication for Elasticsearch?

**URL:** <https://discuss.elastic.co/t/how-to-setup-a-basic-authentication-for-elasticsearch/210286>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [December 3, 2019, 5:05am UTC](https://discuss.elastic.co/t/how-to-setup-a-basic-authentication-for-elasticsearch/210286 "2019-12-03T05:05:37Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 3, 2019, 8:17am UTC](https://discuss.elastic.co/t/how-to-setup-a-basic-authentication-for-elasticsearch/210286/4 "2019-12-03T08:17:16Z")

</div>

I think you need to use `ELASTIC_PASSWORD` instead.  
I shared an example (docker-compose) here: [Create user in elasticsearch](https://discuss.elastic.co/t/create-user-in-elasticsearch/182401/2)

---

_[View the full topic](https://discuss.elastic.co/t/how-to-setup-a-basic-authentication-for-elasticsearch/210286)._
