Search code examples
memgraphdb

Is data lost when Memgraph that runs on Docker is restarted?


I want to run the Memgprah platform inside Docker (on Windows 10 machine, if it is important). What will happen if I restart my computer or Docker service? Will my data be saved?


Solution

  • Docker containers don’t persist data by default (all changes are lost when the container is stopped). But here is a way to avoid data loss.

    You need to use local volumes to store the data permanently, which is why Memgraph is started with the -v flag:

    docker run -p 7687:7687 -v mg_lib:/var/lib/memgraph memgraph/memgraph