Table of Contents
Redis is a high-performance in-memory data store commonly used for caching, sessions, queues, and real-time workloads. CentOS Stream 9 provides Redis through official repositories, making installation clean and stable.
Step 1: Update System Packages
Start with an up-to-date system.
sudo dnf update -y
Step 2: Install Redis Server
Install Redis from the CentOS 9 repositories:
sudo dnf install -y redis
This installs both the Redis server and the redis-cli tool.
Step 3: Enable and Start Redis Service
Ensure Redis starts automatically and is running:
sudo systemctl enable --now redis
Check service status:
systemctl status redis
You should see active (running).
Step 4: Test Redis Installation
Verify Redis is responding:
redis-cli ping
Expected output:
PONG
Step 5: Configure Redis for systemd Supervision
CentOS 9 uses systemd, so Redis must be supervised correctly.
Edit the configuration file:
sudo nano /etc/redis/redis.conf
Find and set:
supervised systemd
Restart Redis:
sudo systemctl restart redis
Step 6: Secure Redis (Local Access Only)
Redis must never be exposed publicly.
Check bind address:
grep ^bind /etc/redis/redis.conf
It should be:
bind 127.0.0.1 ::1
Also ensure:
protected-mode yes
Restart Redis after changes:
sudo systemctl restart redisU
Loading...
