Redis with docker

Redis with docker

This post shows how to install Redis server with docker

  • To start/restart the 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 the value associated with a key