How to install Redis on Rocky Linux 9

Sam

Code for this tutorial can be found on GitHub

Rocky Linux

Why Rocky Linux?

Rocky Linux is a drop in replacement for CentOS and Red Hat Enterprise Linux (RHEL). As claimed by the Rocky team it is a 100% bug for bug compatible for RHEL. This means it makes a great operating system to host applications in production.

One common piece of architecture is Redis, it can be used in for multiple things including as a cache, message queue, session storage, and even for pub/sub architecture. Let's see how we can install and run Redis on our Rocky Linux 9 machine.

Install

Installing Redis on our Rocky Linux 9 machine is as easy as running the following commands:

sudo yum install redis
sudo systemctl enable redis
sudo systemctl start redis

These three lines are doing the following:

  1. Installing Redis using the YUM package manager which is a nicer abstraction over the RPM package manager
  2. Enables the redis service using systemctl
  3. Starts the redis service using systemctl

Now when our machine restarts and boots Redis will automatically start. To check the status of the redis service we can run:

sudo systemctl status redis

Wrapping up

That is a short and sweet guide on how to get Redis up and running on your Rocky Linux 9 machine. Remember there can be a lot more to do regarding securing Redis and making sure it's not exposed to the Internet. We will explore that in a later tutorial.

Until then, have a great day and happy coding!

Table of Contents