# Redis: Could not connect to Redis at 10.0.0.5:6379: Connection timed out

**Code:** `Can't connect to Redis from another host (bind 127.0.0.1)` · **Category:** Redis · **Seen on:** Redis, Linux

Redis only listens on localhost by default, so remote clients time out or are refused.

## Meaning

Set `bind 127.0.0.1 10.0.0.5` (private IP) in `redis.conf`, restart, require a password, and open 6379 only to app servers via firewall/security groups. Never expose Redis publicly: unauthenticated Redis instances get compromised within minutes.

## Common causes

- `bind 127.0.0.1` (default)
- Firewall/security group blocks 6379
- Cloud private IP not in `bind`
- Docker published port bound to localhost only
- NAT/port mapping missing

## Quick fix

1. Edit `/etc/redis/redis.conf`: `bind 127.0.0.1 10.0.0.5` and `requirepass ...` then restart
2. Allow 6379 only from app servers
3. Test: `nc -vz 10.0.0.5 6379`

## Detailed fix by platform

### Linux

1. `sudo ss -ltnp | grep redis; sudo ufw status | grep 6379`

## How to diagnose

1. **Bind** — Interfaces?
2. **Firewall** — Port restricted?
3. **Auth** — Password set?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/redis/redis-bind-remote-connection-timed-out)
