This guide will show you how to set up Redis and PHP Redis to dramatically increase the performance of your server.

Redis is an open-source solution that functions as a database of structured cached data that is saved in your server’s RAM. Instead than relying on disk delay, the cache will deliver significantly higher throughput because it is stored in memory.

The guide presupposed that you have a CentOS 7 server with cPanel installed. If you have a Managed Server the installation can be done by our support.

1) Login through SSH and run the following commands :

sudo yum install epel-release yum-utils
sudo yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo yum-config-manager --enable rem
yum install redis

2) Once installed, you would need to start it:

sudo systemctl start redis
sudo systemctl enable redis
sudo systemctl status redis

The latest command should give you a confirmation of that Redis is running.

sudo systemctl status redis
● redis.service – Redis persistent key-value database
Loaded: loaded (/usr/lib/systemd/system/redis.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/redis.service.d
└─limit.conf
Active: active (running) since Fri 2021-09-17 12:41:53 EDT; 8s ago
Main PID: 17753 (redis-server)
CGroup: /system.slice/redis.service
└─17753 /usr/bin/redis-server 127.0.0.1:6379

It also returns the port being used (here 6379) which you may need for your application.

3) log in to WHM and search in the WHM sidebar for Module Installers. Click on it and then click on Manage PHP PECL.

4) At the next stage, select the PHP version you would like to install Redis For and inside the Module Search type Redis and click on Go

5) Finally, in the search result click on Install and after a few seconds, it should be completed.

That’s it, you have now enabled a Redis Cache on your server.

./