ACL SETUSER live only in memory. As soon as you restart the container — and certainly if you docker rm it — the users are gone and only the default user remains.
This guide shows how to configure FalkorDB so that ACL users, hashed passwords, and permissions are stored on disk and reloaded automatically on every restart.
How It Works
Redis (and therefore FalkorDB) supports two ways of storing ACL users:- Inline in
redis.conf(rewritten withCONFIG REWRITE). - In a dedicated ACL file referenced by the
aclfiledirective, written withACL SAVE.
aclfile is set, Redis uses the file as the single source of truth for users at startup, and ACL SAVE will persist any in-memory changes back to it. This is the approach we use here, because it works cleanly with the FalkorDB Docker image (which doesn’t ship a writable redis.conf).
Prerequisites
- Docker installed.
- The
falkordb/falkordb(orfalkordb/falkordb-server) image. redis-cliavailable locally for testing.
Step 1: Prepare the Host Directory and ACL File
Create a directory on the host that will be bind-mounted into the container, and create an empty ACL file inside it. The file must exist before the container starts — Redis will refuse to start ifaclfile points to a missing file.
Step 2: Start FalkorDB With an ACL File
Pass--aclfile (and optionally --appendonly yes for data persistence) through the REDIS_ARGS environment variable. The FalkorDB entrypoint forwards REDIS_ARGS to redis-server.
-v ~/falkordb/data:/var/lib/falkordb/databind-mounts the host directory into FalkorDB’s default data directory, so both the AOF/RDB files andusers.acllive on the host.--aclfile /var/lib/falkordb/data/users.acltells Redis to load users from — andACL SAVEto write users to — that file.--appendonly yesenables AOF so that the graph data is also durable. See Data Durability for the full set of options.
Step 3: Create ACL Users and Save Them
Connect withredis-cli and create some users:
Important:Persist the users to disk:ACL SETUSERonly updates the in-memory user table. You must runACL SAVEto write the changes to the ACL file. Ifaclfileis not configured,ACL SAVEreturns a clear error:If you see this error, check that--aclfilewas passed (e.g. viaREDIS_ARGS) and that the file existed on disk before the container started.
Step 4: Verify Persistence Across Restarts
Restart — or even fully recreate — the container, then confirm the users are still there:alice and bob users (along with their hashed passwords and rules) are reloaded from users.acl.
Docker Compose Example
docker compose up, create the ACL file so Redis can open it:
Operational Notes
- Always run
ACL SAVEafter changes.ACL SETUSER,ACL DELUSER, andACL SETUSER ... resetonly affect memory until you persist them. - Disable the
defaultuser in production. Once your real users exist, lock it down:ACL SETUSER default off. Make sure at least one administrative user with+@allpermissions remains enabled. - Protect the ACL file. It contains password hashes. Restrict host filesystem permissions:
chmod 600 ~/falkordb/data/users.acl. - Snap-installed Docker. If your Docker Engine was installed via Snap, bind mounts only work under your home directory — paths like
/tmp/...will appear empty inside the container. - Mixing inline and file-based ACLs. When
aclfileis set, you cannot also setuserdirectives inredis.conf. Choose one mechanism.
Related
- Persistence on Docker — persisting graph data with volumes and verifying data durability.
- Data Durability — RDB/AOF configuration.
- ACL command reference — all ACL subcommands.
- Redis ACL documentation — full rule syntax.
Frequently Asked Questions
Why do my ACL users disappear after restarting the container?
Why do my ACL users disappear after restarting the container?
By default, ACL users live only in memory. You must configure
--aclfile /path/to/users.acl via REDIS_ARGS and run ACL SAVE after creating users to persist them to disk.Do I need to create the ACL file before starting the container?
Do I need to create the ACL file before starting the container?
Yes. Redis will refuse to start if the
aclfile directive points to a non-existent file. Create an empty file first: touch ~/falkordb/data/users.acl.Can I mix inline ACL users in redis.conf with an ACL file?
Can I mix inline ACL users in redis.conf with an ACL file?
No. When
aclfile is set, you cannot also define user directives in redis.conf. Choose one mechanism for managing ACL users.How do I secure the ACL file on the host?
How do I secure the ACL file on the host?
Restrict filesystem permissions since the file contains password hashes:
chmod 600 ~/falkordb/data/users.acl. Ensure only the Docker process and administrators can read it.What happens if I forget to run ACL SAVE?
What happens if I forget to run ACL SAVE?
Any users created with
ACL SETUSER remain only in memory. They will be lost on the next container restart. Always run ACL SAVE after making ACL changes.