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:
- Installing Redis using the YUM package manager which is a nicer abstraction over the RPM package manager
- Enables the redis service using systemctl
- 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!