To install Redis on CentOS 7, follow these steps:

Install the EPEL (Extra Packages for Enterprise Linux) repository if it is not already on your system:

sudo yum install epel-release

Connect the repository and install Redis:

sudo yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm

yum --enablerepo=remi install redis

sudo systemctl enable --now redis

You can check the status with the command:

sudo systemctl status redis -l

If you need to access the database from outside and set a password, you need to edit redis.conf and lock the 2 parameters bind and requirepass:

  • bind: The IP address on which Redis will listen for connections. By default, it listens on all interfaces.
  • requirepass: password to access Redis. Uncomment this line and set a password if required.

sudo vi /etc/redis.conf

set up in the file

bind 0.0.0.0

requirepass mypassword

Rebooting redis

sudo systemctl restart redis

Check again that the radish is running and there are no errors

sudo systemctl status redis -l

You can check the connection to redis with the command

 redis-cli

After that you will see the line

127.0.0.1:6379>

Type in

auth mypassword

You should see an OK. Then your connection is properly established.
Redis is now installed and running on your CentOS 7 server. You can use Redis to store and process data in your application.

Comments:
Log in to leave a comment.
user Vitalka Hz Vitalka Hz 23.10.2024, 10:06 how to install centos 9 stream ?
hmara admin HMARA.IO Team 23.10.2024, 19:29 here is the instruction Install Redis on CentOS 9