Redis connection refused in Laravel - Rocketeers app

  [ Rocketeers ](/)   

[Login](https://rocketeersapp.com/login) 

 On this page

 Knowledge
---------

Redis connection refused in Laravel
===================================

### [\#Laravel](https://rocketeersapp.com/knowledge/laravel)

When Laravel uses Redis for cache, sessions or queues, a "Connection refused" error means it cannot reach the Redis server. Usually the service is down or the host is wrong, especially in Docker.

 Published by [Mark van Eijk](https://rocketeersapp.com/author/mark-van-eijk) on June 23, 2026 · 1 minute read

1. [About the error](#content-about-the-error)
2. [Why do I see this error](#content-why-do-i-see-this-error)
3. [Solution](#content-solution)
4. [Check Redis is running](#content-check-redis-is-running)
5. [Verify the connection settings](#content-verify-the-connection-settings)
6. [Docker: use the service name](#content-docker-use-the-service-name)
7. [Clear cached config](#content-clear-cached-config)

[\#](#content-about-the-error "Permalink")About the error
---------------------------------------------------------

 ```
Predis\Connection\ConnectionException: Connection refused [tcp://127.0.0.1:6379]

```

(Or the phpredis equivalent.) Laravel tried to open a connection to Redis and nothing accepted it at that address. This is different from an authentication or wrong-database error, the connection never got established at all.

[\#](#content-why-do-i-see-this-error "Permalink")Why do I see this error
-------------------------------------------------------------------------

- Redis isn't running.
- `REDIS_HOST` or `REDIS_PORT` is wrong.
- **In Docker**, `127.0.0.1` from inside the app container points at the container itself, not the Redis container.
- Redis requires a password (`requirepass`) that you haven't set in `.env`.

[\#](#content-solution "Permalink")Solution
-------------------------------------------

### [\#](#content-check-redis-is-running "Permalink")Check Redis is running

 ```
systemctl status redis-server
redis-cli ping     # should reply PONG

```

If `ping` replies `PONG`, the server is up and the problem is how Laravel addresses it.

### [\#](#content-verify-the-connection-settings "Permalink")Verify the connection settings

 ```
REDIS_HOST=127.0.0.1
REDIS_PORT=6379
REDIS_PASSWORD=null

CACHE_STORE=redis
SESSION_DRIVER=redis
QUEUE_CONNECTION=redis

```

### [\#](#content-docker-use-the-service-name "Permalink")Docker: use the service name

Inside a container, `127.0.0.1` is the container, not the host. Set `REDIS_HOST` to the **service name** from your `docker-compose.yml`:

 ```
REDIS_HOST=redis

```

 ```
services:
  redis:
    image: redis:7
    ports:
      - "6379:6379"

```

### [\#](#content-clear-cached-config "Permalink")Clear cached config

If you changed `.env` but Laravel still connects to the old address, the config is cached:

 ```
php artisan config:clear

```

See [environment variables in Laravel](/environment-variables-laravel) for how these values are loaded, and [SQLSTATE\[HY000\] \[2002\] Connection refused](/sqlstate-hy000-2002-connection-refused) for the same class of "can't reach the service" problem with MySQL.

### Subscribe to our newsletter

Do you want to receive regular updates with fresh and exclusive content to learn more about web development, hosting, security and performance? Subscribe now!

  Fill in your email address to receive updates  Subscribe 

#### More in [\#Laravel](https://rocketeersapp.com/knowledge/laravel)

- [How to use different PHP versions with Laravel Valet](https://rocketeersapp.com/knowledge/different-php-versions-laravel-valet)
- [Disable cookies in Laravel](https://rocketeersapp.com/knowledge/disable-cookies-in-laravel)
- [Logging in Laravel](https://rocketeersapp.com/knowledge/laravel-logging)
- [How to check which Laravel version of your app is using](https://rocketeersapp.com/knowledge/check-laravel-version)
- [Disable CSRF in Laravel](https://rocketeersapp.com/knowledge/disable-csrf-in-laravel)
- [Creating an encrypted cookie value in Laravel](https://rocketeersapp.com/knowledge/creating-an-encrypted-cookie-value-in-laravel)

 [View all 19 articles →](https://rocketeersapp.com/knowledge/laravel)
