How to secure a Redis server exposed to the internet
Redis has no authentication by default. Exposed to the internet it's trivially taken over for data theft, persistence and mining. Fix it now.
Steps
- In redis.conf set bind 127.0.0.1 (or a private interface) and leave protected-mode yes.
- Set a strong requirepass, or define ACL users with least privilege.
- Close 6379 at the firewall so it's never reachable from the internet.
- Restart Redis and rotate any data or credentials if it was previously open.
How to verify
- From outside, redis-cli -h <ip> ping should fail or require AUTH.
- ss -tlnp | grep 6379 shows it bound to localhost, not 0.0.0.0.
FAQ
- Is a password enough if the port is public?
- No — keep Redis on a private network as well. A public data port is still brute-forceable and a bigger attack surface.
Have SkyShield check this for you
SkyShield finds this across every server and cloud account and shows the fix in plain words. Free for one server, then from $49 per server a month. Start free.