# Redis: Error: connect ECONNREFUSED 127.0.0.1:6379 / Could not connect to Redis at 127.0.0.1:6379: Connection refused

**Code:** `Error: connect ECONNREFUSED 127.0.0.1:6379` · **Category:** Redis · **Seen on:** Redis, Node.js, Linux

Nothing is listening on the Redis host/port your client uses.

## Meaning

Redis isn't running, listens elsewhere (`bind`, `port`), or you're in Docker where `localhost` is the app container. Start it (`sudo systemctl start redis-server`, `brew services start redis`), check `ss -ltnp | grep 6379`, `redis-cli ping`, and use the service name in compose/Kubernetes.

## Common causes

- Redis server not running or crashed
- Wrong host/port in the client config
- Docker/K8s: localhost instead of service name
- `bind`/`protected-mode` limiting access
- Redis on a different port (e.g. 6380 TLS)

## Quick fix

1. `sudo systemctl status redis-server` and start it
2. Test: `redis-cli -h HOST -p 6379 ping`
3. Use the compose service name (`redis`)

## Detailed fix by platform

### Linux

1. `ss -ltnp | grep 6379 && redis-cli ping`

## How to diagnose

1. **Server** — Running?
2. **Host/port** — Correct?
3. **Network** — Docker service name?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/redis/econnrefused-6379)
