How to Install Redis on AlmaLinux 10
Introduction
Redis is a high-performance, in-memory data store that is widely used as a cache, message broker, and database. It supports various data structures, including strings, hashes, lists, sets, and sorted sets.
This guide explains how to install Redis on AlmaLinux 10, start the service, verify the installation, and perform basic configuration.
Prerequisites
Before installing Redis, ensure that:
* You are running AlmaLinux 10.
* You have sudo or root privileges.
* Your system is connected to the Internet.
Update System Packages
Update your package metadata:
Install Redis
Install Redis using DNF:
Verify that Redis has been installed:
Start and Enable Redis
Enable Redis to start automatically at boot:
Start the Redis service:
Check the service status:
The service should display **active (running)**.
Verify the Installation
Display the installed Redis version:
Or:
Test Redis
Open the Redis command-line interface:
Set a test value:
Retrieve the value:
Expected output:
Exit the Redis CLI:
Redis Configuration File
The default configuration file is located at:
You can edit the configuration using:
After modifying the configuration, restart Redis:
Redis Data Directory
Redis stores persistent data in:
To check the directory size:
Common Redis Commands
Stop Redis:
Restart Redis:
Disable automatic startup:
Check whether Redis is responding:
Expected output:
Uninstall Redis
Remove Redis:
Optionally remove the data directory:
Conclusion
Installing Redis on AlmaLinux 10 is straightforward using the DNF package manager. After installation, start the Redis service, verify the installation using `redis-cli`, and use Redis as a fast in-memory data store for caching and application development.