Redis |> How to Install Redis Cli Only on Your macOS/Linux



IF YOU JUST SOLVED SOME PROBLEM, WELCOME TO DM qaRabbit ON TWITTER, OR CREATE A PULL REQUEST IN GITHUB REPO.

On macOS

During modern development, we rarely need to install a redis server on Local(Development) machine. On the other hand, we do need a redis client (CLI or GUI) to access redis server.

Many people don’t care the fact that in order to insall client, they install both server and client.

YOU may find many great GUI redis clients, while I prefer a old cli way: run redis-server in docker, then start a new temporary redis-server container to start redis-cli

# start redis-server

docker run --name redis-dev -v YOUR_LOCAL_REDIS_DATA_DIR:/data -p 127.0.0.1:6379:6379 -d redis:alpine redis-server --appendonly yes

# start redis-cli

docker run --rm -it --link redis-dev:redis redis:alpine redis-cli -n 9 -h redis

redis:6379[9]> keys *

On GNU/Linux, you can easily find package like: redis-cli to install.


Reference: