# Persist data- Index pattern, dashboards gets wiped when container restarted

**URL:** <https://discuss.elastic.co/t/persist-data-index-pattern-dashboards-gets-wiped-when-container-restarted/233616>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [May 20, 2020, 8:53pm UTC](https://discuss.elastic.co/t/persist-data-index-pattern-dashboards-gets-wiped-when-container-restarted/233616 "2020-05-20T20:53:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mehak\_Bhargava](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mehak_bhargava/32/54750_2.png) [@Mehak\_Bhargava](https://discuss.elastic.co/u/Mehak_Bhargava)\
**Post date:** [May 20, 2020, 8:53pm UTC](https://discuss.elastic.co/t/persist-data-index-pattern-dashboards-gets-wiped-when-container-restarted/233616/1 "2020-05-20T20:53:40Z")

</div>

I am running my ELK and Beats services inside a docker container. I have created multiple index patterns and dashboards. But whenever I restart the docker container, the data gets wiped out. Is there a way to persist all this data and make sure the dashboards don't keep disappearing?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [May 20, 2020, 8:55pm UTC](https://discuss.elastic.co/t/persist-data-index-pattern-dashboards-gets-wiped-when-container-restarted/233616/2 "2020-05-20T20:55:48Z")

</div>

Are you using persistent storage for your Elasticsearch container?

---

<div class="post-metadata">

**Author:** ![Mehak\_Bhargava](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mehak_bhargava/32/54750_2.png) [@Mehak\_Bhargava](https://discuss.elastic.co/u/Mehak_Bhargava)\
**Post date:** [May 20, 2020, 9:01pm UTC](https://discuss.elastic.co/t/persist-data-index-pattern-dashboards-gets-wiped-when-container-restarted/233616/3 "2020-05-20T21:01:23Z")

</div>

Could you please elaborate what that means and would look like? Thank you!

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [May 20, 2020, 9:15pm UTC](https://discuss.elastic.co/t/persist-data-index-pattern-dashboards-gets-wiped-when-container-restarted/233616/4 "2020-05-20T21:15:44Z")

</div>

Have you mapped a data path to the container that survives restarts? What does your docket file look like?

---

<div class="post-metadata">

**Author:** ![Mehak\_Bhargava](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mehak_bhargava/32/54750_2.png) [@Mehak\_Bhargava](https://discuss.elastic.co/u/Mehak_Bhargava)\
**Post date:** [May 27, 2020, 6:14pm UTC](https://discuss.elastic.co/t/persist-data-index-pattern-dashboards-gets-wiped-when-container-restarted/233616/5 "2020-05-27T18:14:10Z")

</div>

Thnaks a lot @Christian_Dahlqvist for this suggestion. I am going to follow this article to set up teh cluster.

> **[How to use persistent storage for elasticsearch in docker](https://ervikrant06.github.io/elk/ELK-docker-compose/)**
>
> In the previous article, we have started the docker containers using docker run command, and while starting the ES container we haven’t used the persistent storage to save the indexes which means that if container is stop/start then all data will be...

---

<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:** [June 24, 2020, 6:14pm UTC](https://discuss.elastic.co/t/persist-data-index-pattern-dashboards-gets-wiped-when-container-restarted/233616/6 "2020-06-24T18:14:19Z")

</div>

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