Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

daprezjer's avatar

Connection refused [tcp://127.0.0.1:8002] for redis connection w/ Docker

I'm using Laravel with docker and am new to installing redis. I've added redis locally via brew, and have it started up with redis-server. It's reporting initialized and ready to accept connections via tcp.

In Docker Compose, I've associated port 8002 with the redis port of 6379.

redis:
  image: redis:alpine
  container_name: my-redis
  command: redis-server --appendonly yes
  volumes:
  - ./data/redis:/data
  ports:
    - "8002:6379"

In Laravel, I've changed my session driver to redis in my .env file, and for the database config, i've noted:

'redis' => [
    'client' => env('REDIS_CLIENT', 'predis'),
    'default' => [
        'port' => env('REDIS_PORT', 6379),
        'host' => env('REDIS_HOST', 'localhost'),
        'password' => env('REDIS_PASSWORD', 'null'),
    ],

When I try to load the site, which is calling for the session, I'm getting Connection refused [tcp://127.0.0.1:8002]

I'm not sure if it matters, but you can see I'm trying to use predis as the client.

Any help would be appreciated!

0 likes
1 reply
daprezjer's avatar

Generic question too: I'm going w/ Redis because I'm not finding any good queue management tools for database queuing. So I installed Horizon and am trying to update to redis.

Any good DB queue management tools that show a visual interface like horizon does for redis?

Please or to participate in this conversation.