skip to content
Alvin Lucillo

Local redis insight with redis

/ 1 min read

Without using Redis Cloud, you can start with its image. Below creates a container our of redis image and sets and retrieves the key.

 docker run -d --name redis -p 6379:6379 redis:8.2
Unable to find image 'redis:8.2' locally
8.2: Pulling from library/redis
ae4ce04d0e1c: Pull complete 
cabab18c1c1a: Pull complete 
2eb55aef3ac2: Pull complete 
e792c41e6f0b: Pull complete 
bdef44dbb29f: Pull complete 
4f4fb700ef54: Pull complete 
c5a0e5a08c5f: Pull complete 
Digest: sha256:d869e31b96ddc72c49ab3c5b3638487ce5c39c2ba19cd7e1c782317ed39c8b7a
Status: Downloaded newer image for redis:8.2
20f43f4cdc433ba2f6209a5190c0b48ccbf94edb343358b73bd85c31934d481c
  docker exec -it redis redis-cli
127.0.0.1:6379> help
redis-cli 8.2.3
To get help about Redis commands type:
      "help @<group>" to get a list of commands in <group>
      "help <command>" for help on <command>
      "help <tab>" to get a list of possible help topics
      "quit" to exit

To set redis-cli preferences:
      ":set hints" enable online hints
      ":set nohints" disable online hints
Set your preferences in ~/.redisclirc
127.0.0.1:6379> SET mykey HelloWorld
OK
127.0.0.1:6379> GET mykey
"HelloWorld"
127.0.0.1:6379>