Skip to main content
FalkorDB supports advanced configurations to enable data persistence, ensuring that your data is safe and remains intact even after container restarts. This guide will walk you through setting up FalkorDB in Docker with persistence enabled.

Prerequisites

Before you begin, ensure you have the following:
  • Docker installed on your machine.
  • A working FalkorDB Docker image. You can pull it from Docker Hub.
  • Basic knowledge of Docker commands and configurations.

Step 1: Setting Up Persistence

Persistence in FalkorDB allows you to store your data on the host machine, ensuring that it is not lost when the container restarts.

1.1 Create a Persistent Volume

First, create a Docker volume to store the data:
This volume will be used to store the database files.

1.2 Start FalkorDB with the Persistent Volume

You can now run FalkorDB with the volume attached:
Configuration details:
  • The -v falkordb_data:/var/lib/falkordb/data flag mounts the volume to the /var/lib/falkordb/data directory inside the container
  • FalkorDB stores its data in the /var/lib/falkordb/data directory by default

Step 2: Verifying the Setup

To verify that persistence is working correctly, follow these steps:

2.1 Create Test Data

2.2 Restart Container

2.3 Verify Data Persists

Best Practices

  • Backup Regularly: Even with persistence, maintain regular backups of your data
  • Monitor Disk Space: Ensure sufficient disk space is available for the volume
  • Use Named Volumes: Named volumes are easier to manage than bind mounts

Understanding Durability Options

Docker volume configuration ensures your data persists across container restarts, but FalkorDB also provides multiple durability mechanisms (RDB snapshots, AOF logging) to protect against data loss and optimize for different use cases. For a comprehensive guide on configuring RDB, AOF, and graph-specific backup options, see Data Durability.

ACL User Persistence

Docker volume configuration persists your graph data, but ACL users created with ACL SETUSER are stored separately in an ACL file. To persist users, passwords, and permissions across restarts, see ACL Persistence on Docker.

Next Steps

With persistence configured, FalkorDB is now set up for reliable data storage that remains intact across container restarts. For high availability and data redundancy, explore Replication to set up multiple FalkorDB instances.

Frequently Asked Questions

FalkorDB stores data in /var/lib/falkordb/data by default. Mount your Docker volume to this path: -v falkordb_data:/var/lib/falkordb/data.
Named volumes are recommended for most cases as they are easier to manage and portable. Use bind mounts only when you need to map a specific host directory for backups or shared access.
Create test data, stop and restart the container, then query the data again. If it returns your previously created nodes, persistence is configured correctly.
No. ACL users are stored separately in memory by default. To persist ACL users, configure an ACL file with --aclfile and store it on the mounted volume. See ACL Persistence.