> ## Documentation Index
> Fetch the complete documentation index at: https://kb.mochahost.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure Redis for Drupal Application

Before you proceed please follow the steps on this [TUTORIAL](https://clientarea.mochahost.com/knowledgebase/871) in order to **enable REDIS** via your Cpanel. After that follow the steps below to configure REDIS for your Drupal application:

## How to configure REDIS

1. Login to your DRUPAL admin panel.

2. Navigate trough the following steps - **Drupal Admin area >> Extend >> + Install new module >> Install from a URL >>[https://www.drupal.org/project/redis](https://www.drupal.org/project/redis) >> Install.**

For installation URL please choose: [https://ftp.drupal.org/files/projects/redis-8.x-1.0-rc2.tar.gz](https://ftp.drupal.org/files/projects/redis-8.x-1.0-rc2.tar.gz) (or a newer version for Redis if available)

![](https://tutorials.my-virtual-panel.com/Drupal_Redis/1_Drupal_Redis.png)

3. Click **Enable newly added modules** and enable **Redis**.

![](https://tutorials.my-virtual-panel.com/Drupal_Redis/2_Drupal_Redis.png)

4. **Edit Drupal settings file** at **./sites/default/settings.php** and add these lines at the bottom of the file:

`$conf['redis\_client\_interface'] = 'Predis'; 
 $conf['redis\_client\_host'] = 'hostname'; 
 $conf['redis\_client\_port'] = port; 
 $conf['redis\_client\_password'] = 'password'; 
 $conf['lock\_inc'] = 'sites/all/modules/contrib/redis/redis.lock.inc'; 
 $conf['cache\_backends'][] = 'sites/all/modules/contrib/redis/redis.autoload.inc'; 
 $conf['cache\_default\_class'] = 'Redis\_Cache';`

PS: The variables you should edit: **hostname, port, password** are found on your **Cpanel > Redis information**.

5. Clear your Drupal cache: **Admin >> Configuration >> Performance >> Clear all caches** and then visit the status report page: **Admin >> Reports >> Status report**.

If everything is correctly set the line next to REDIS should show -- **Connected**

![](https://tutorials.my-virtual-panel.com/Drupal_Redis/3_Drupal_Redis.png)
