Featured image of post Fix Redis Connection Refused After Upgrading to 6.0

Fix Redis Connection Refused After Upgrading to 6.0

Redis 6.0 changed the defaults for bind and protected-mode, causing Connection refused errors. Adjust two settings in redis.conf to restore connectivity.

Problem

After upgrading Redis to 6.0.5, connecting with redis-cli threw this error:

1
Could not connect to Redis at 127.0.0.1:6379: Connection refused

Starting from Redis 6.0, the default configuration binds to specific network interfaces, and protected-mode defaults to yes, which blocks even localhost connections.

Solution

Edit redis.conf and adjust two settings:

1
2
3
4
5
# Comment out the bind line to make Redis listen on all interfaces
# bind 192.168.0.5

# Disable protected mode
protected-mode no

Restart Redis after making the changes and connections should work again.

Note

This is fine for development environments. For production, keep protected-mode yes and use password authentication or firewall rules to control access instead.

Licensed under CC BY-SA 4.0