Making Redis ACL Users Persistent (Fix Users Disappearing After Reboot)
If you’ve ever configured users and roles in Redis using ACL and noticed that everything works fine… until you restart the server, you’re…
Making Redis ACL Users Persistent (Fix Users Disappearing After Reboot)
If you’ve ever configured users and roles in Redis using ACL and noticed that everything works fine… until you restart the server, you’re not alone.
After a reboot, Redis may silently drop your users, especially if they were not properly persisted.
This guide walks you through the correct, production-safe way to make Redis ACL users permanent.
The Problem
You create users using:
ACL SETUSER ...
Everything works perfectly.
But after restarting Redis:
sudo systemctl restart redis-server
Your users are gone.
Why this happens?
By default, Redis:
- Stores ACL users in memory
- Does NOT persist them automatically
- Requires explicit configuration to save them permanently
The Solution: Use an ACL File
To make users persistent, Redis must be configured to use an external ACL file.
Step-by-Step Fix
1. Add ACL File Directive in Redis Config
Open your Redis configuration:
sudo nano /etc/redis/redis.conf
Scroll to the bottom and add:
aclfile /etc/redis/users.acl
Important (Very Common Mistake)
If you previously added users directly inside redis.conf, remove those lines.
Redis will ignore them once aclfile is used.
2. Create the ACL File
Redis will fail to start if the file doesn’t exist.
sudo touch /etc/redis/users.acl
sudo chown redis:redis /etc/redis/users.acl
3. Restart Redis
sudo systemctl restart redis-server
Now Redis is ready to persist users.
4. Add Users via Redis CLI
Connect to Redis:
redis-cli
Or if you’re using a different port:
redis-cli -p <port>
5. Create Users (Generalized Template)
Inside the CLI:
ACL SETUSER default off
#This will Create one super User with All the permission
ACL SETUSER <username> on >password ~* &* +@all
#This will Create one read User with Read Permission
ACL SETUSER <readonly_user> on >password ~* &* -@all +@read +subscribe +psubscribe
Then save:
ACL SAVE
If You Get This Error
ERR This Redis instance is not configured to use an ACL file
👉 Don’t panic.
This means Redis didn’t properly load the ACL file.
Fix:
Run:
CONFIG REWRITE
This forces Redis to persist the configuration correctly.
Final Verification
Restart Redis again:
sudo systemctl restart redis-server
Try logging in with your users (e.g., via Redis CLI or Redis Insight)
If everything is correct, your users will still exist after reboot.
Key Takeaways
- Redis does not persist ACL users by default
Always use:
aclfile /path/to/users.acl
Never mix:
- Users in
redis.conf - AND
aclfile
Use:
ACL SAVE→ to write usersCONFIG REWRITE→ if things break
Conclusion
If your Redis users disappear after reboot, the root cause is almost always missing ACL persistence configuration.
By introducing an ACL file and properly saving users, you ensure:
- 🔐 Secure authentication
- 🔁 Persistence across restarts
- ⚙️ Production-ready Redis setup
If you want, you can extend this by adding monitoring, role-based separation, or integrating Redis authentication into your application stack.
메타데이터
- post_id
- 2cc501c7bdcb
- slug
- making-redis-acl-users-persistent-fix-users-disappearing-after-reboot-2cc501c7bdcb
- url
- https://medium.com/@deevpatel223/making-redis-acl-users-persistent-fix-users-disappearing-after-reboot-2cc501c7bdcb
- canonical_url
- https://medium.com/@deevpatel223/making-redis-acl-users-persistent-fix-users-disappearing-after-reboot-2cc501c7bdcb
- author_url
- https://medium.com/@deevpatel223
- status
- ok
- fetched_at
- 2026-07-22 08:21:35