Can't connect to Redis from another host (bind 127.0.0.1) Redis Origin: Data OSI layer 4 · Transport Last updated 5 Nov 2026

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

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

Exact message you may see Could not connect to Redis at 10.0.0.5:6379: Connection timed outredis.exceptions.TimeoutError: Timeout connecting to serverRedis connection timed out remote host bind 127.0.0.1ETIMEDOUT 10.0.0.5:6379 redisCould not connect to Redis at 10.0.0.5:6379: No route to host
Seen on: Redis Linux

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?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Data. Errors that are often confused with or caused by this one (click to open):

default backend - 404 — Ingress returns "404 Not Found" / "default backend - 404" (ingress-nginx) (Kubernetes)default backend - 404DENIED Redis is running in protected mode — Redis: DENIED Redis is running in protected mode because protected mode is enabled and no password is set for the default user (Redis)DENIED Redis is runni…DNS in pod — DNS not working inside a Kubernetes pod (could not resolve host / nslookup: can't resolve) (Kubernetes)DNS in podenv() returns null (config cached) — Laravel: .env changes ignored / env('X') returns null after php artisan config:cache (Laravel)env() returns null (c…ERR CONFIG SET failed (possibly related to argument) — Redis: (error) ERR CONFIG SET failed (possibly related to argument 'maxmemory') - can't set immutable config (Redis)ERR CONFIG SET failed…ERR DB index is out of range — Redis: (error) ERR DB index is out of range / ERR SELECT is not allowed in cluster mode (Redis)ERR DB index is out o…ERR This instance has cluster support disabled — Redis: (error) ERR This instance has cluster support disabled (Redis)ERR This instance has…Error: connect ECONNREFUSED 127.0.0.1:6379 — Redis: Error: connect ECONNREFUSED 127.0.0.1:6379 / Could not connect to Redis at 127.0.0.1:6379: Connection refused (Redis)Error: connect ECONNR…Can't con…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.