# How do I disable X-Pack security on the elasticsearch 5.2.2 docker image?

**URL:** <https://discuss.elastic.co/t/how-do-i-disable-x-pack-security-on-the-elasticsearch-5-2-2-docker-image/78183>\
**Category:** Elasticsearch\
**Created:** [March 10, 2017, 8:55pm UTC](https://discuss.elastic.co/t/how-do-i-disable-x-pack-security-on-the-elasticsearch-5-2-2-docker-image/78183 "2017-03-10T20:55:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sivabalans](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@sivabalans](https://discuss.elastic.co/u/sivabalans)\
**Post date:** [March 10, 2017, 8:55pm UTC](https://discuss.elastic.co/t/how-do-i-disable-x-pack-security-on-the-elasticsearch-5-2-2-docker-image/78183/1 "2017-03-10T20:55:21Z")

</div>

This image comes bundled with X-Pack security. I see a question about an image without X-Pack. But I am also ok with a way to disable it in the docker image. I am aware of how to disable it in the elasticsearch.yml file but I need to be able to disable it when I start the elasticsearch docker container. Any ideas?

---

<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:** [March 10, 2017, 10:03pm UTC](https://discuss.elastic.co/t/how-do-i-disable-x-pack-security-on-the-elasticsearch-5-2-2-docker-image/78183/2 "2017-03-10T22:03:46Z")

</div>

You probably want to read [https://www.elastic.co/guide/en/x-pack/5.2/installing-xpack.html#xpack-enabling](https://www.elastic.co/guide/en/x-pack/5.2/installing-xpack.html#xpack-enabling)

---

<div class="post-metadata">

**Author:** ![sivabalans](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@sivabalans](https://discuss.elastic.co/u/sivabalans)\
**Post date:** [March 10, 2017, 10:15pm UTC](https://discuss.elastic.co/t/how-do-i-disable-x-pack-security-on-the-elasticsearch-5-2-2-docker-image/78183/3 "2017-03-10T22:15:58Z")

</div>

Thanks. I tried doing that with the following command. But it did not take effect. How should I be disabling it on the docker image?

docker run -d -p 9200:9200 --name elasticsearch -e "http.host=0.0.0.0" -e "transport.host=127.0.0.1" -e "xpack.security.enabled=false" -v /data/sw/elasticsearch/data:/usr/share/elasticsearch/data [docker.elastic.co/elasticsearch/elasticsearch:5.2.2](http://docker.elastic.co/elasticsearch/elasticsearch:5.2.2)

---

<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:** [March 10, 2017, 10:28pm UTC](https://discuss.elastic.co/t/how-do-i-disable-x-pack-security-on-the-elasticsearch-5-2-2-docker-image/78183/4 "2017-03-10T22:28:13Z")

</div>

It worked for me.

I just ran:

```auto
docker run -d -p 9200:9200 --name elasticsearch -e "http.host=0.0.0.0" -e "transport.host=127.0.0.1" -e "xpack.security.enabled=false" docker.elastic.co/elasticsearch/elasticsearch:5.2.2

```

```auto
curl 127.0.0.1:9200

```

And got:

```auto
{
  "name" : "NA9O7g6",
  "cluster_name" : "docker-cluster",
  "cluster_uuid" : "4c9iUQZSTN2XlRb_7wnY4g",
  "version" : {
    "number" : "5.2.2",
    "build_hash" : "f9d9b74",
    "build_date" : "2017-02-24T17:26:45.835Z",
    "build_snapshot" : false,
    "lucene_version" : "6.4.1"
  },
  "tagline" : "You Know, for Search"
}

```

---

<div class="post-metadata">

**Author:** ![sivabalans](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@sivabalans](https://discuss.elastic.co/u/sivabalans)\
**Post date:** [March 10, 2017, 10:41pm UTC](https://discuss.elastic.co/t/how-do-i-disable-x-pack-security-on-the-elasticsearch-5-2-2-docker-image/78183/5 "2017-03-10T22:41:11Z")

</div>

Thanks for trying it out. I have been struggling with it for the last couple of days. Are you sure you have x-pack security turned on in your image? What happens when you run the following docker command?

docker run -d -p 9200:9200 --name elasticsearch -e "http.host=0.0.0.0" -e "transport.host=127.0.0.1" [docker.elastic.co/elasticsearch/elasticsearch:5.2.2](http://docker.elastic.co/elasticsearch/elasticsearch:5.2.2)

---

<div class="post-metadata">

**Author:** ![sivabalans](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@sivabalans](https://discuss.elastic.co/u/sivabalans)\
**Post date:** [March 10, 2017, 10:48pm UTC](https://discuss.elastic.co/t/how-do-i-disable-x-pack-security-on-the-elasticsearch-5-2-2-docker-image/78183/6 "2017-03-10T22:48:58Z")

</div>

Never mind. It worked for me this time. All this time, I was passing the -u elastic parameter along with the curl command and that was prompting me for the password and not the x-pack security. Thanks a bunch for your prompt response.

---

<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:** [April 7, 2017, 10:49pm UTC](https://discuss.elastic.co/t/how-do-i-disable-x-pack-security-on-the-elasticsearch-5-2-2-docker-image/78183/7 "2017-04-07T22:49:01Z")

</div>

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