# How to save docker elastic search data permanently in azure storage

**URL:** <https://discuss.elastic.co/t/how-to-save-docker-elastic-search-data-permanently-in-azure-storage/374654>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [February 17, 2025, 5:45pm UTC](https://discuss.elastic.co/t/how-to-save-docker-elastic-search-data-permanently-in-azure-storage/374654 "2025-02-17T17:45:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Constellation2025](https://avatars.discourse-cdn.com/v4/letter/c/3ab097/32.png) [@Constellation2025](https://discuss.elastic.co/u/Constellation2025)\
**Post date:** [February 17, 2025, 5:45pm UTC](https://discuss.elastic.co/t/how-to-save-docker-elastic-search-data-permanently-in-azure-storage/374654/1 "2025-02-17T17:45:58Z")

</div>

How can I permanently save Elasticsearch data in Azure while using Docker, ensuring that the data remains intact even if the container is stopped or restarted?

---

<div class="post-metadata">

**Author:** ![Quentin\_Pradet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/quentin_pradet/32/94192_2.png) [@Quentin\_Pradet](https://discuss.elastic.co/u/Quentin_Pradet)\
**Post date:** [February 18, 2025, 5:26am UTC](https://discuss.elastic.co/t/how-to-save-docker-elastic-search-data-permanently-in-azure-storage/374654/2 "2025-02-18T05:26:40Z")

</div>

Hello, and welcome! In addition to Stephen's notes below, please refer to [Snapshot and restore | Elasticsearch Guide [8.17] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/snapshot-restore.html) to backup your data.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [February 18, 2025, 5:54am UTC](https://discuss.elastic.co/t/how-to-save-docker-elastic-search-data-permanently-in-azure-storage/374654/3 "2025-02-18T05:54:13Z")

</div>

Hi @Constellation2025 Welcome the community.

I recommend reading the production notes here carefully

> **[Install Elasticsearch with Docker | Elasticsearch Guide \[8.17\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#docker-prod-prerequisites)**

Especially about binding data volumes

> **[Install Elasticsearch with Docker | Elasticsearch Guide \[8.17\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#_always_bind_data_volumes)**

> Always bind data volumes  
> edit  
> You should use a volume bound on /usr/share/elasticsearch/data for the following reasons:

> The data of your Elasticsearch node won’t be lost if the container is killed  
> Elasticsearch is I/O sensitive and the Docker storage driver is not ideal for fast I/O  
> It allows the use of advanced Docker volume plugins

If you don't on know about docker volumes you should read that

> **[Volumes](https://docs.docker.com/engine/storage/volumes/)**
>
> Learn how to create, manage, and use volumes instead of bind mounts for persisting data generated and used by Docker.

---

<div class="post-metadata">

**Author:** ![Constellation2025](https://avatars.discourse-cdn.com/v4/letter/c/3ab097/32.png) [@Constellation2025](https://discuss.elastic.co/u/Constellation2025)\
**Post date:** [February 19, 2025, 1:43pm UTC](https://discuss.elastic.co/t/how-to-save-docker-elastic-search-data-permanently-in-azure-storage/374654/4 "2025-02-19T13:43:01Z")

</div>

I am using volumes like - es\_data:/usr/share/elasticsearch/data but still losing data on every restart

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [February 19, 2025, 2:01pm UTC](https://discuss.elastic.co/t/how-to-save-docker-elastic-search-data-permanently-in-azure-storage/374654/5 "2025-02-19T14:01:17Z")

</div>

Then you are not setting up the volumes correctly or some how running a cleanup volumes...

Are you following these instructions?

> **[Install Elasticsearch with Docker | Elasticsearch Guide \[8.17\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#docker-compose-file)**

I run this over and over and down compose down and the compose up and the data remains.

You will need to share you entire compose and all commands you are running, what OS etc..etc..

---

<div class="post-metadata">

**Author:** ![Constellation2025](https://avatars.discourse-cdn.com/v4/letter/c/3ab097/32.png) [@Constellation2025](https://discuss.elastic.co/u/Constellation2025)\
**Post date:** [February 19, 2025, 3:19pm UTC](https://discuss.elastic.co/t/how-to-save-docker-elastic-search-data-permanently-in-azure-storage/374654/6 "2025-02-19T15:19:26Z")

</div>

Not sure what is happening when it reaches max storage on restart, why does it remove anything in elastic in azure. I have data to store more than 275505879
