How To Install Redis on Fedora 37
In this tutorial, we will show you how to install Redis on Fedora 37. For those of you who didn’t know, Redis is a popular open-source in-memory database that is commonly used as a cache and message broker and more. Redis supports different kinds of abstract data structures, such as strings, lists, maps, sets, sorted sets, HyperLogLogs, bitmaps, streams, and spatial indices.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo
‘ to the commands to get root privileges. I will show you the step-by-step installation of the Redis on a Fedora 37.
Prerequisites
- A server running one of the following operating systems: Fedora 37.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- SSH access to the server (or just open Terminal if you’re on a desktop).
- A
non-root sudo user
or access to theroot user
. We recommend acting as anon-root sudo user
, however, as you can harm your system if you’re not careful when acting as the root.
Install Redis on Fedora 37
Step 1. Before proceeding, update your Fedora operating system to make sure all existing packages are up to date. Use this command to update the server packages:
sudo dnf upgrade sudo dnf update
Step 2. Installing Redis on Fedora 37.
By default, the Redis package comes in the default repository of Fedora 37. Now run the following command below to install the latest version of Redis to your Fedora system:
sudo dnf install redis
After the installation is complete, you can start the Redis service by running:
sudo systemctl enable redis --now
Step 3. Configure Redis Server on Fedora.
Now open the Redis configuration file in your favorite editor:
sudo nano /etc/redis.conf
Set the desired memory capacity for your application:
maxmemory 512mb maxmemory-policy allkeys-lru
Save and close the configuration file, then restart Redis to apply the changes:
sudo systemctl restart redis-server
Step 4. Configure Firewall.
By default, Redis listens on port 6379. If any firewall is installed and configured on your server, then you will need to allow ports via firewalld. You can allow them with the following command:
sudo firewall-cmd --permanent --new-zone=redis sudo firewall-cmd --permanent --zone=redis --add-port=6379/tcp sudo firewall-cmd --reload
Step 5. Connect to Redis.
After complete configure and installation, now we tested at the start of the guide by pinging your Redis service to ensure it was operational, you can try the firewall rules and changes in IP by using the “redis-cli
” command:
redis-cli -h [ip address] ping
If setup correctly, the output should be:
pong
Congratulations! You have successfully installed Redis. Thanks for using this tutorial for installing Redis on your Fedora 37 system. For additional help or useful information, we recommend you check the official Redis website.