# How to shutdown ES using API call

**URL:** <https://discuss.elastic.co/t/how-to-shutdown-es-using-api-call/336210>\
**Category:** Elasticsearch\
**Created:** [June 16, 2023, 10:22am UTC](https://discuss.elastic.co/t/how-to-shutdown-es-using-api-call/336210 "2023-06-16T10:22:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ANUBHAV\_GUPTA](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@ANUBHAV\_GUPTA](https://discuss.elastic.co/u/ANUBHAV_GUPTA)\
**Post date:** [June 16, 2023, 10:22am UTC](https://discuss.elastic.co/t/how-to-shutdown-es-using-api-call/336210/1 "2023-06-16T10:22:44Z")

</div>

Hi, I am wondering if there is a way or an API using which I can shutdown my ES server?

---

<div class="post-metadata">

**Author:** ![chinmoy\_padhi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chinmoy_padhi/32/68568_2.png) [@chinmoy\_padhi](https://discuss.elastic.co/u/chinmoy_padhi)\
**Post date:** [June 16, 2023, 10:42am UTC](https://discuss.elastic.co/t/how-to-shutdown-es-using-api-call/336210/2 "2023-06-16T10:42:26Z")

</div>

Is this what you are looking for

> **[Put shutdown API | Elasticsearch Guide \[8.8\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/put-shutdown.html)**

---

<div class="post-metadata">

**Author:** ![ANUBHAV\_GUPTA](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@ANUBHAV\_GUPTA](https://discuss.elastic.co/u/ANUBHAV_GUPTA)\
**Post date:** [June 16, 2023, 10:57am UTC](https://discuss.elastic.co/t/how-to-shutdown-es-using-api-call/336210/3 "2023-06-16T10:57:48Z")

</div>

I looked into this but it's somehow not working for me.  
Do I need to follow some steps to enable this?

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [June 16, 2023, 1:00pm UTC](https://discuss.elastic.co/t/how-to-shutdown-es-using-api-call/336210/4 "2023-06-16T13:00:23Z")

</div>

> [@ANUBHAV\_GUPTA](#):
>
> I looked into this but it's somehow not working for me.  
> Do I need to follow some steps to enable this?

This API just prepares the node for the shutdown, it will not terminate the process in the server, you need to do this yourself using another tool or directly on the server.

There is no API that will terminate the process.

---

<div class="post-metadata">

**Author:** ![ANUBHAV\_GUPTA](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@ANUBHAV\_GUPTA](https://discuss.elastic.co/u/ANUBHAV_GUPTA)\
**Post date:** [June 16, 2023, 3:47pm UTC](https://discuss.elastic.co/t/how-to-shutdown-es-using-api-call/336210/5 "2023-06-16T15:47:22Z")

</div>

Actually, I am running Elasticsearch using docker and I want to stop the server in a clean way and not by pressing `ctrl+c` and docker stop.  
So, Is there a way I can do that?

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [June 16, 2023, 4:51pm UTC](https://discuss.elastic.co/t/how-to-shutdown-es-using-api-call/336210/6 "2023-06-16T16:51:54Z")

</div>

> [@ANUBHAV\_GUPTA](#):
>
> So, Is there a way I can do that?

This is an infrastructure issue then, not an Elasticsearch one.

There is no API in Elasticsearch that would shutdown the node, the documentation linked is an API to prepare the node to be decomissioned, also the `_shutdown` API only works when you are running Elasticsearch using Elastic Cloud, ECE or ECK, which is not your case.

If you are using Docker compose you will just use `docker compose down`, if you are running the node directly from the cli, a CTRL+C is the way to stop.

Both cases will result on a graceful shutdown of the service.

---

<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:** [July 14, 2023, 4:52pm UTC](https://discuss.elastic.co/t/how-to-shutdown-es-using-api-call/336210/7 "2023-07-14T16:52:00Z")

</div>

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