Fix the Redis Auth warning in rConfig V8 Core
After reading this page, I can clear the Redis Auth warning on the rConfig V8 Core dashboard by requiring a password on Redis, confirm the fix from the command line, and recheck the dashboard straight away. It also covers every message the check and the commands can print, and what to do about each one.
When to use this
Section titled “When to use this”Use this page when the dashboard Health Status panel shows a Redis Auth alert, when php artisan rconfig:redis-security-check exits non-zero, or when Horizon logs NOAUTH errors after a Redis password change. New installs and update.sh on V8.2.19+ set a password for you, so you mostly land here after upgrading an older install, on a server shared with rConfig Pro, or after Redis was reinstalled.
Why does Redis need a password?
Section titled “Why does Redis need a password?”rConfig V8 Core uses Redis for its job queue, cache and sessions. Horizon workers take jobs off the queue and run them, so anything that can write to Redis can make a worker run code. A Redis password is the control that closes this.
Binding Redis to 127.0.0.1 is not enough on its own. Any process on the server can reach a loopback listener, including connections rConfig itself opens on behalf of devices. That is why the check reports the bind address and protected mode for context only, and never passes on them.
What does the Redis Auth check report?
Section titled “What does the Redis Auth check report?”The scheduler runs the health checks every five minutes and the dashboard shows the latest result. The check has three outcomes:
| Dashboard | Message | Meaning |
|---|---|---|
| Green, no alert | Redis requires authentication. |
Redis rejects clients without a password. Nothing to do. |
| Red alert | Redis has no password set. Run: php artisan rconfig:redis-secure |
Redis accepts any local client. Follow the steps below. |
| Amber alert | Redis is unreachable; authentication state could not be determined. |
The check could not connect to Redis at all. See Redis is unreachable. |
The same state is available from the command line with php artisan rconfig:redis-security-check, which is read only and safe to run at any time.
Prerequisites
Section titled “Prerequisites”- Shell access to the rConfig server with
sudo. - rConfig V8 Core V8.2.19+. On older releases, run
sudo ./update.shfirst (see How to update rConfig V8 Core), which also sets the password for you. - The rConfig folder path. The examples use
/var/www/html/rconfig. - To know whether any other application uses the same Redis instance, for example rConfig Pro installed on the same server. If one does, read Redis shared with another application before you start.
How do I secure Redis?
Section titled “How do I secure Redis?”-
Go to the rConfig folder.
Terminal window cd /var/www/html/rconfig -
Check the current state.
Terminal window php artisan rconfig:redis-security-checkOn an unsecured install the output looks like this:
ERROR Redis has no password set. Run: php artisan rconfig:redis-securePassword required ............................................. noApp can authenticate .......................................... yesBind (context only) ................................. 127.0.0.1 -::1Protected mode (context only) ................................. yesThe exit code tells scripts the same thing:
0means a password is required,1means Redis has no password,2means Redis could not be reached. -
Preview the change. Nothing is altered.
Terminal window php artisan rconfig:redis-secure --dry-run -
Secure Redis.
Terminal window php artisan rconfig:redis-secureThe command generates a 64 character password, writes it to
REDIS_PASSWORDin.env, rebuilds the config cache if one exists, requires the password on the running Redis withCONFIG SET requirepass, saves it to the Redis config file withCONFIG REWRITE, and signals Horizon and the queue workers to restart so they reconnect with it. Supervisor relaunches Horizon on its own. A successful run ends with:INFO Redis is now secured. Verify with: php artisan rconfig:redis-security-checkIf it prints a warning instead, find the message under Troubleshooting.
-
Verify the fix.
Terminal window php artisan rconfig:redis-security-checkecho $?You should see
Redis requires authentication., both Password required and App can authenticate set toyes, and an exit code of0. -
Recheck the dashboard now rather than waiting for the next five minute run. Run the health checks as the web server user, not as root:
Terminal window # RHEL, Rocky, Almasudo -u apache php artisan health:check# Ubuntusudo -u www-data php artisan health:checkRefresh the dashboard. The Redis Auth alert is gone.
From V8.2.19+, the rConfig V8 Core image secures Redis when the container starts. Its entrypoint generates a password the first time, writes it to REDIS_PASSWORD in .env, and adds requirepass to the Redis config before Redis starts. Later restarts reuse the same password.
-
Make sure you are running a V8.2.19+ image. See Docker deployments.
-
Restart the container so the entrypoint runs.
Terminal window docker restart <container-name> -
Verify the fix from inside the container.
Terminal window docker exec -it <container-name> php artisan rconfig:redis-security-check -
Recheck the dashboard straight away.
Terminal window docker exec -it -u www-data <container-name> php artisan health:check
Do not set REDIS_PASSWORD in the environment: block of your compose file. A real environment variable overrides .env, so the application would keep using that value while Redis requires the one the entrypoint wrote.
How do I rotate the Redis password?
Section titled “How do I rotate the Redis password?”Rotate the password if it may have leaked, for example after .env was copied somewhere it should not have been.
cd /var/www/html/rconfigphp artisan rconfig:redis-secure --forcephp artisan rconfig:redis-security-check--force generates and applies a new password even when one is already set. Any other application that shares this Redis instance must be given the new value.
Troubleshooting
Section titled “Troubleshooting”Redis is unreachable
Section titled “Redis is unreachable”The dashboard shows an amber alert and rconfig:redis-security-check exits 2. The check could not open a connection, so it cannot say whether a password is required.
-
Check that Redis is running.
Terminal window # RHEL, Rocky, Almasudo systemctl status redis# Ubuntusudo systemctl status redis-server -
Start it if it is stopped, and enable it at boot.
Terminal window sudo systemctl enable --now redis # RHEL, Rocky, Almasudo systemctl enable --now redis-server # Ubuntu -
Confirm rConfig points at the right host and port. The check connects to
REDIS_HOSTandREDIS_PORTfrom.env(default127.0.0.1and6379).Terminal window grep -E '^REDIS_(HOST|PORT)=' /var/www/html/rconfig/.envredis-cli -h 127.0.0.1 -p 6379 pingPONGorNOAUTH Authentication requiredboth mean Redis is listening. A connection error means it is not, or is on another address. -
Rerun
php artisan rconfig:redis-security-checkand continue from the result.
“REDIS_PASSWORD is set in .env but the live Redis does not accept it (desync)”
Section titled ““REDIS_PASSWORD is set in .env but the live Redis does not accept it (desync)””rconfig:redis-secure stops rather than overwrite a password it did not set. .env and Redis disagree, so Horizon cannot connect either. Pick one:
- Let rConfig set a fresh password on both sides:
php artisan rconfig:redis-secure --force. This needs Redis to accept rConfig’s current credential (or no password) so it can change it. - Keep the password Redis already has: copy the
requirepassvalue from your Redis config file intoREDIS_PASSWORDin.env, then runphp artisan config:cacheif your install caches config, and restart Horizon withphp artisan horizon:terminate.
“CONFIG REWRITE failed: the password is live but not persisted”
Section titled ““CONFIG REWRITE failed: the password is live but not persisted””Redis accepted the password but could not save it to its config file, usually because it was started without one. The password works now and is lost when Redis restarts, which brings the red alert back. Add it to the config file by hand:
-
Read the password rConfig set.
Terminal window grep '^REDIS_PASSWORD=' /var/www/html/rconfig/.env -
Add or replace the
requirepassline in the Redis config file with that value.Terminal window sudo vi /etc/redis/redis.conf # older releases: /etc/redis.conf# requirepass <value of REDIS_PASSWORD>sudo systemctl restart redisTerminal window sudo vi /etc/redis/redis.conf# requirepass <value of REDIS_PASSWORD>sudo systemctl restart redis-server -
Restart Horizon so it reconnects, then verify.
Terminal window cd /var/www/html/rconfigphp artisan horizon:terminatephp artisan rconfig:redis-security-check
“The new password could not be verified against the live instance”
Section titled ““The new password could not be verified against the live instance””The password was applied but a fresh connection with it failed. Run php artisan rconfig:redis-security-check. If Password required is yes and App can authenticate is no, follow the desync steps above.
App can authenticate reports no, or Horizon logs NOAUTH
Section titled “App can authenticate reports no, or Horizon logs NOAUTH”Redis requires a password, so the dashboard check passes, but the application is not sending the right one and queued jobs fail. This happens when the password in .env is wrong, when a cached config still holds an old value, or when Horizon kept a connection opened before the change.
cd /var/www/html/rconfigphp artisan rconfig:redis-security-check # confirm App can authenticate: nophp artisan config:cache # only if your install caches configphp artisan horizon:terminate # Supervisor relaunches HorizonIf it still reports no, the value in .env does not match Redis. Follow the desync steps above.
Redis shared with another application
Section titled “Redis shared with another application”If rConfig Pro, or anything else, uses the same Redis instance, it loses access as soon as a password is set. update.sh skips this step when it sees another application’s Horizon on the server and prints a warning instead. Choose one approach before you secure Redis:
- Share the password. Run
php artisan rconfig:redis-securein rConfig V8 Core, copyREDIS_PASSWORDfrom its.envinto the other application’s.env, then restart that application’s Horizon. - Separate the instances. Run a second Redis instance on another port for one of the applications, point its
REDIS_PORTat it, and secure each one.
What’s next
Section titled “What’s next”- Fix the Worker Privilege warning, the other security check on the dashboard health panel
- Harden rConfig V8 Core across authentication, network, server and Redis
- Look up every rconfig:redis-secure option in the CLI commands reference