redis-cli Quick Start
Verify a local PostRESP instance, run your first Redis commands, and peek at SQL storage.
Use redis-cli to verify a local PostRESP instance, exercise common commands, and
inspect the same keys in Postgres.
Prerequisites
redis-cli- A local PostRESP instance from the Docker Quick Start or Postgres extensions
- A local port for RESP (examples use
6379)
Start PostRESP first
For the fastest local setup, start with Docker:
docker run -d --name postresp \
-p 6379:6379 \
-p 5432:5432 \
-e POSTRESP_PASSWORD=postresp \
asamsig/postresp:latest
If you already have an instance running, skip ahead.
Connect and verify
redis-cli -p 6379 PING
Expected reply:
PONG
If you published RESP on another host port (for example -p 5762:6379):
redis-cli -p 5762 PING
Wire auth is off by default. When you enable RequireClientAuth, pass
-a / run AUTH. See Authentication.
Your first commands
Strings, TTL, and a simple list:
redis-cli -p 6379 SET session:1 '{"user":"ada"}'
redis-cli -p 6379 GET session:1
# {"user":"ada"}
redis-cli -p 6379 EXPIRE session:1 60
redis-cli -p 6379 TTL session:1
# 60 (or slightly less)
redis-cli -p 6379 LPUSH jobs task-a
redis-cli -p 6379 LPUSH jobs task-b
redis-cli -p 6379 LRANGE jobs 0 -1
# 1) "task-b"
# 2) "task-a"
Interactive mode works the same way:
redis-cli -p 6379
127.0.0.1:6379> SET foo bar
OK
127.0.0.1:6379> GET foo
"bar"
127.0.0.1:6379> DEL foo
(integer) 1
See Commands for the full support matrix.
Peek at SQL storage
The same keys live in schema pgresp.
Values are bytea (shown hex-encoded in psql):
# Docker install (SQL admin)
docker exec -it postresp \
psql -U postgres -d postgres -c "SELECT * FROM pgresp.strings;"
# Extension install (local psql)
psql -U postgres -d postgres -c "SELECT * FROM pgresp.strings;"
You can also call SQL helpers directly — for example
SELECT pgresp.get('session:1'); — when debugging from the Postgres side.
Point your app at it
Same URL shape as Redis:
REDIS_URL=redis://127.0.0.1:6379
Continue with Connect from your app for language examples.
Troubleshooting
If redis-cli does not connect on the first try:
- Confirm the container or Postgres host is up (
docker ps, or check the postmaster). - Inspect Docker startup with
docker logs postresp. - Confirm you are using the published host port, not only the container port, when ports are remapped.
- For extension installs, ensure
pg_resp_gw_hostis inshared_preload_librariesand the extensions were created in the configured database — see Postgres extensions.