Hero Image

Install Redis on Debian 12

Install Redis on Debian 12

Step 1 – Install Redis

apt update && apt upgrade -y
apt install -y redis-server
systemctl enable --now redis-server

Step 2 – Verify

redis-cli ping
# Expected: PONG

Step 3 – Basic security (bind and password)

Edit /etc/redis/redis.conf:

bind 127.0.0.1 ::1
requirepass StrongRedisPass!

Restart Redis.

Step 4 – Connect with password

redis-cli -a StrongRedisPass! ping

Step 5 – Basic data operations

redis-cli -a StrongRedisPass!
> SET mykey "hello"
> GET mykey
> SET counter 0
> INCR counter
> EXPIRE mykey 3600
> TTL mykey