Access redis running on docker from localhost

Run redis on docker

sudo docker run --name my-redis-container -p 7001:6379 -d redis

This will start redis on port 6397 on docker and expose that on port 7001. Now we can access redis via cli from our local host.

sudo redis-cli -h localhost -p 7001

Leave a Comment

Your email address will not be published. Required fields are marked *