Redis with docker

Redis with docker

This post shows how to install redis server with docker

  • To start/restart redis server
docker container stop redis; docker run --name redis -p 6379:6379 -v $HOME/redis:/data --rm -d redis:5.0.3 redis-server --requirepass <password>

Replace <password> with your random password string

  • To query
docker exec -it redis redis-cli
  • In redis command prompt
AUTH <password>
keys *
MGET <key>

to authenticate, retrieve all keys, get value associated with key