How to Install Redis on CentOS 7

About Redis

Redis is an open-source, in-memory, data structure store with optional disk writes for persistence. It can be used as a key-value database, or as a cache and message broker. Redis features built-in transactions, replication, and support for a variety of data structures such as strings, hashes, lists, sets, and others. Redis can be made highly available with Redis Sentinel and supports automatic partitioning with Redis Cluster.

Prerequisites

  • User to have root privileges

Step One — Add Epel Repository

To add Epel repo, open the terminal and run the below command

sudo yum install epel-release

Step Two — Install Redis

Now repository is installed on the server, to install nginx use below command

sudo yum install redis -y

Step Three — Start Redis

sudo systemctl start redis

To ensure the redis service started successfully by using below command,

sudo systemctl status redis

To automatically start Redis on boot:

sudo systemctl enable redis

Step Four – Verify the Installation

Verify that Redis is running with redis-cli:

redis-cli ping

If Redis is running, it will return:

PONG

Congratulations! Redis is now installed and running!

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *