How to Install Redis on AlmaLinux 10

Published: 2026-06-27
Google AdSense 广告位 (待申请通过后开启)

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:

sudo dnf update -y

Install Redis

Install Redis using DNF:

sudo dnf install redis -y

Verify that Redis has been installed:

rpm -q redis

Start and Enable Redis

Enable Redis to start automatically at boot:

sudo systemctl enable redis

Start the Redis service:

sudo systemctl start redis

Check the service status:

sudo systemctl status redis

The service should display **active (running)**.

Verify the Installation

Display the installed Redis version:

redis-server --version

Or:

redis-cli --version

Test Redis

Open the Redis command-line interface:

redis-cli

Set a test value:

SET greeting "Hello Redis"

Retrieve the value:

GET greeting

Expected output:

"Hello Redis"

Exit the Redis CLI:

exit

Redis Configuration File

The default configuration file is located at:

/etc/redis.conf

You can edit the configuration using:

sudo vi /etc/redis.conf

After modifying the configuration, restart Redis:

sudo systemctl restart redis

Redis Data Directory

Redis stores persistent data in:

/var/lib/redis

To check the directory size:

sudo du -sh /var/lib/redis

Common Redis Commands

Stop Redis:

sudo systemctl stop redis

Restart Redis:

sudo systemctl restart redis

Disable automatic startup:

sudo systemctl disable redis

Check whether Redis is responding:

redis-cli ping

Expected output:

PONG

Uninstall Redis

Remove Redis:

sudo dnf remove redis -y

Optionally remove the data directory:

sudo rm -rf /var/lib/redis

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.

Explore More

Technology Guides →

Southeast Asia Insights →