DW
DataWells
← All Guides
🗄️

How to Secure Exposed Redis

Secure your exposed Redis server

Port 6379 · Databases

Step 1.Set a password

Redis has no auth by default. Set requirepass in redis.conf.

# /etc/redis/redis.conf
requirepass YOUR_STRONG_PASSWORD

Step 2.Bind to localhost

Change bind from 0.0.0.0 to 127.0.0.1.

# /etc/redis/redis.conf
bind 127.0.0.1

Step 3.Disable dangerous commands

Rename or disable dangerous commands in redis.conf.

rename-command FLUSHALL ""
rename-command CONFIG ""

Step 4.Firewall the port

Block port 6379 from the internet.

sudo ufw deny 6379
After fixing:Use our Self-Check Tool to verify the port is no longer exposed.