Installing Redis

This section outlines the process for installing and configuring Redis.

Redis, an in-memory data structure store widely used as a database, cache, and message broker. Redis is essential for high-performance data management and real-time processing in modern applications. This page explains how to set up Redis, enable remote access, and customize its configuration.

Prerequisites

Make sure the following things are in place, before installing:

  • Root access to the VM

To install and configure Redis, follow the steps below:

  1. Run the following bash command to update all existing system packages:
    dnf update
  2. After updating the packages, install the EPEL repository to access additional packages.
    dnf install epel-release
  3. Install Redis using the following command.
    dnf install redis
  4. Check if Redis is installed and its service status.
    systemctl status redis
  5. Start the Redis service if it is not running.
    systemctl start redis
  6. To configure Redis for Remote Access, navigate to the Redis configuration directory.
    cd /etc
  7. Open the Redis configuration file in a text editor as shown below.
    vi redis.conf
  8. Find the line containing bind 127.0.0.1 and comment it out by adding # at the beginning, and add the following line to allow connections from any IP address:.
    #bind 127.0.0.1
    bind 0.0.0.0
  9. Stop and restart the Redis service to apply the new configuration.
    systemctl stop redis
    systemctl start redis
  10. Now, Redis is configured and ready to use with remote access enabled.