# How can I disable elasticsearch from boot auto start

**URL:** <https://discuss.elastic.co/t/how-can-i-disable-elasticsearch-from-boot-auto-start/201717>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [October 1, 2019, 3:16am UTC](https://discuss.elastic.co/t/how-can-i-disable-elasticsearch-from-boot-auto-start/201717 "2019-10-01T03:16:04Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abdul\_Rahuman](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@Abdul\_Rahuman](https://discuss.elastic.co/u/Abdul_Rahuman)\
**Post date:** [October 1, 2019, 3:16am UTC](https://discuss.elastic.co/t/how-can-i-disable-elasticsearch-from-boot-auto-start/201717/1 "2019-10-01T03:16:04Z")

</div>

Hi everyone I would like to know how to **disable auto start elasticsearch** i'm using ubuntu 18.04 and my elasticsearch is running on docker .. I should control my elasticsearch on docker manually not automatically whenever I try to boot or restart my server elasticsearch is up .

please help me thank you

---

<div class="post-metadata">

**Author:** ![MiTschMR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mitschmr/32/48254_2.png) [@MiTschMR](https://discuss.elastic.co/u/MiTschMR)\
**Post date:** [October 1, 2019, 7:21am UTC](https://discuss.elastic.co/t/how-can-i-disable-elasticsearch-from-boot-auto-start/201717/2 "2019-10-01T07:21:56Z")

</div>

Hi @Abdul_Rahuman

You can set the flag "--restart" for a container, the docker documentation reference is [here](https://docs.docker.com/config/containers/start-containers-automatically/).

Hope this helps.

---

<div class="post-metadata">

**Author:** ![Abdul\_Rahuman](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@Abdul\_Rahuman](https://discuss.elastic.co/u/Abdul_Rahuman)\
**Post date:** [October 1, 2019, 10:29am UTC](https://discuss.elastic.co/t/how-can-i-disable-elasticsearch-from-boot-auto-start/201717/3 "2019-10-01T10:29:24Z")

</div>

so how can I disable it ? I don't need auto start elasticsearch container

---

<div class="post-metadata">

**Author:** ![MiTschMR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mitschmr/32/48254_2.png) [@MiTschMR](https://discuss.elastic.co/u/MiTschMR)\
**Post date:** [October 1, 2019, 11:10am UTC](https://discuss.elastic.co/t/how-can-i-disable-elasticsearch-from-boot-auto-start/201717/4 "2019-10-01T11:10:32Z")

</div>

Hi @Abdul_Rahuman

Please read the description of the options. I recommend to use the flag "no" when creating the container, so that the container never restarts. How do you create the container now? Can you please post the command?

---

<div class="post-metadata">

**Author:** ![Abdul\_Rahuman](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@Abdul\_Rahuman](https://discuss.elastic.co/u/Abdul_Rahuman)\
**Post date:** [October 1, 2019, 11:31am UTC](https://discuss.elastic.co/t/how-can-i-disable-elasticsearch-from-boot-auto-start/201717/5 "2019-10-01T11:31:04Z")

</div>

```auto
docker run --name elasticsearch \
-p 9200:9200 \
-p 9300:9300 \
–v /opt/esdata:/usr/share/elasticsearch/data \
-e xpack.security.enabled="false" \
--restart always \
-d docker.elastic.co/elasticsearch/elasticsearch:5.6.8

```

I created this way long ago and my ES container is running up to now but I would like to disable auto start after the installation like this is there any method

---

<div class="post-metadata">

**Author:** ![MiTschMR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mitschmr/32/48254_2.png) [@MiTschMR](https://discuss.elastic.co/u/MiTschMR)\
**Post date:** [October 1, 2019, 12:09pm UTC](https://discuss.elastic.co/t/how-can-i-disable-elasticsearch-from-boot-auto-start/201717/6 "2019-10-01T12:09:09Z")

</div>

Hi

You have the flag --restart set in your command. It has the value always, so it always restarts. You can use the [docker update](https://docs.docker.com/engine/reference/commandline/update/) command to remove the restart flag. Take a look at the examples section there for using the correct syntax.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![Abdul\_Rahuman](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@Abdul\_Rahuman](https://discuss.elastic.co/u/Abdul_Rahuman)\
**Post date:** [October 3, 2019, 4:03am UTC](https://discuss.elastic.co/t/how-can-i-disable-elasticsearch-from-boot-auto-start/201717/7 "2019-10-03T04:03:08Z")

</div>

thanks this solved my prooblem:smiling\_face\_with\_three\_hearts:

---

<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:** [October 31, 2019, 4:03am UTC](https://discuss.elastic.co/t/how-can-i-disable-elasticsearch-from-boot-auto-start/201717/8 "2019-10-31T04:03:09Z")

</div>

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