Redis is an open-source, in-memory data structure store, used as a database, cache, and message broker. This guide will walk you through the installation and security steps for Redis on AlmaLinux 9.
Prerequisites
- A server running AlmaLinux 9.
- A user with sudo privileges.
Step 1: Install Redis
Update your system’s package index and install Redis:
sudo dnf update
sudo dnf install redis
Start and enable Redis to start on boot:
sudo systemctl start redis
sudo systemctl enable redis
Step 2: Secure Redis
Redis is designed to be accessed by trusted clients inside trusted environments. To add a layer of security, you can configure a password and bind Redis to localhost.
Edit the Redis configuration file:
sudo nano /etc/redis.conf
Uncomment the line to bind Redis to localhost:
bind 127.0.0.1
Uncomment the line to require a password and set a strong password:
requirepass yourpassword
Restart Redis to apply the changes:
sudo systemctl restart redis
Step 3: Verify Redis Installation
Check the status of Redis:
sudo systemctl status redis
Connect to Redis using the Redis CLI:
redis-cli
Authenticate with your password:
AUTH yourpassword
Conclusion
You've successfully installed and secured Redis on your AlmaLinux 9 server. For more information on how to use Redis, visit the official Redis documentation.