Spoiler: It took me 1.5 days to do what could’ve been done in an hour—but that’s how you learn!
The Setup
I had two servers:
🖥️ A Linux server (Oracle Linux) where Redis was installed
💻 A Windows server running an application that needed to connect to Redis on port 6379
I thought: "Just install Redis, open port 6379, and boom—it works!"
But no, it wasn't that simple.
First Mistake: Trusting the Defaults
I installed Redis using dnf
, which was easy enough. The real challenge started when I tried to connect from the Windows server. The connection kept failing—despite Redis running fine locally on the Linux machine.
I dove into the redis.conf
file (the default config file created during installation), and here’s what I had to change:
bind 0.0.0.0
protected-mode no
These two lines are critical:
bind 0.0.0.0
: Allows connections from any IP, not just localhost.
protected-mode no
: Disables Redis’s "safe mode" that blocks external access.
After applying these changes and running redis-server redis.conf
, I connected successfully from the Linux host using redis-cli
. All seemed fine.
The Real Error: DENIED by Protected Mode
However, from the Windows server, I still couldn’t connect. A telnet to port 6379
returned this error:
DENIED Redis is running in protected mode...
Even though I had disabled protected-mode, Redis still refused the connection.
The missing piece? Authentication.
Fixing It with Docker and a Custom redis.conf
To get more control and test things cleanly, I ran Redis using Docker and created a custom redis.conf
:
bind 0.0.0.0
port 6379
daemonize yes
protected-mode no
requirepass MyStrongPassword
✅ That last line—requirepass
—was the real key.
Once Redis had a password, everything worked. My application connected successfully from the Windows server.
So here’s a quick checklist for allowing remote connections to Redis:
✅ Edit redis.conf
bind 0.0.0.0
protected-mode no
requirepass your_secure_password
✅ Make sure port 6379
is open in the firewall
✅ Restart Redis with the custom config
✅ Test with redis-cli -a your_password -h your_redis_host
What took me 1.5 days could’ve been an hour’s work—but hey, now I really understand Redis’s security model.
If you're setting up Redis for the first time and wondering why remote clients can't connect—check the config. Don't assume it’s the firewall or Docker networking. It's often just a missing requirepass.
Got Tips?
If you have more experience configuring Redis in production or have best practices to share, I’d love to hear from you. This was my first time doing it, and I’m sure there’s room to improve!
Great! Your experience is really valuable and will definitely help others. Keep it up,i'm looking forward to your next posts!👌