Menu

Install Redis on Rocky Linux 9 from the Official Repository

Install Redis on Rocky Linux 9 from the official RPM repository, enable the service, test the connection, and keep port 6379 private.

Posted on By Updated on
On this page

This guide installs Redis Open Source on Rocky Linux 9 from the official Redis RPM repository. It also shows how to start the service and verify a local connection.

Add the Redis repository

Import the Redis signing key:

redis_key_file=$(mktemp)
trap 'rm -f "$redis_key_file"' EXIT
curl -fsSL https://packages.redis.io/gpg -o "$redis_key_file"
sudo rpm --import "$redis_key_file"

Create /etc/yum.repos.d/redis.repo with the Rocky Linux 9 repository configuration published by Redis:

[Redis]
name=Redis
baseurl=http://packages.redis.io/rpm/rockylinux9
enabled=1
gpgcheck=1

The repository enables package signature checking with gpgcheck=1. See the official Redis RPM installation guide for current package-source instructions.

Install and start Redis

Refresh package metadata and install Redis:

sudo dnf makecache
sudo dnf install redis

Enable Redis at boot and start it now:

sudo systemctl enable --now redis
sudo systemctl status redis

Test the local connection

Run PING with the Redis client:

redis-cli PING

A running local server responds with:

PONG

Keep Redis on a trusted network

Redis is designed for trusted clients. Do not expose port 6379 directly to the public internet. Keep the service bound to a private or loopback interface and restrict firewall access to the application hosts that need it. Before enabling remote access, review Redis authentication or ACL settings and TLS requirements. See the official Redis security guide.