How to install Redis and PHP Redis on a cPanel CentOS 7 Server

Throughout this tutorial, you'll learn how to install Redis and the PHP Redis to drastically improve your server's performances

Redis is an open source solution which acts as a database of structured cached data which is stored in a the RAM of your server. Instead of relying on the disk latency, the cache, being in the memory, will provide a way faster throughput. 

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.

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 Sat 2020-06-24 15:21:55 GMT +1; 40s ago
Main PID: 2157 (redis-server)
CGroup: /system.slice/redis.service
        └─2157 /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.

How to install Redis Memory Cache on cPanel CentOS 7

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

How to install Redis Memory Cache on cPanel CentOS 7

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. 

How to install Redis Memory Cache on cPanel CentOS 7

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

 

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to Refresh your cPanel License

If you have purchased your linux VPS along with a cPanel license. Your license won't be active...

How To Clean your cPanel Logs Files in One Go

This tutorial is meant to provide a shortcut to clean your log files in a cPanel Dedicated Server...

How To Update cPanel From SSH or GUI

In order to update the cPanel software on a Linux VPS, there is 2 ways to do it. Upgrading the...

How To Backup / Restore / Export your CSF Firewall Configuration

Whenever you want to deploy a new Linux VPS / Dedicated server, you generally have to set and...

How to Install the CSF / LFD Firewall on your VPS / Dedicated Server

Throughout this guide, you'll learn how to install your own Firewall on your linux VPS /...