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

# Configuring Drupal to use Redis

> Learn how to boost your site's performance by configuring Drupal with Redis. Requires a VPS or Dedicated Server.

This article describes how to configure Drupal 9 to use [Redis](https://redis.io/).

Redis is an open-source memory object caching system that websites can use to help accelerate page load times. Redis works by caching in RAM frequently accessed data, such as the results of API calls, database calls, and more.

<Note>
  * Redis is currently enabled on Turbo shared, Turbo reseller, Managed VPS, and Managed Dedicated server accounts.

  * If you have an unmanaged VPS, you have full root access and can install and configure Redis yourself.

  * Redis is not supported on non-Turbo shared hosting accounts at this time.
</Note>

## Installing the dependencies and module

First, you must install some dependencies and a module so Drupal can access and use Redis. To do this, follow these steps:

1. Log in to your account [using SSH](/docs/using-ssh-secure-shell).

2. At the command prompt, change to the directory where you installed Drupal.

3. Type the following commands:

```bash theme={null}
composer require predis/predis
composer require drupal/redis
cp modules/contrib/redis/example.services.yml sites/default/redis.services.yml
```

4. Log in to your Drupal site as the administrator.

5. On the top menu bar, click **Extend**.

6. On the **List** tab, under **PERFORMANCE**, select the check box next to **Redis**.

7. Click **Install**. You receive a **Module Redis has been enabled** message.

## Configuring Drupal settings

After you install and enable the Redis module, you are ready to configure Drupal to actually use Redis. To do this, follow these steps:

1. In the directory where you installed Drupal, use your preferred text editor to open the *sites/default/settings.php* file.

2. Configure the Redis connection settings:

* If you have a **Managed VPS or Dedicated Server**, copy the following text and append it to the *settings.php* file:

```
$settings['redis.connection']['interface'] = 'Predis';
$settings['redis.connection']['host'] = 'localhost';
$settings['redis.connection']['port'] = '6379';
$settings['cache']['default'] = 'cache.backend.redis';
$settings['container_yamls'][] = 'sites/default/redis.services.yml';
```

* If you have a **Turbo shared or reseller account**, copy the following text and append it to the *settings.php* file. Replace ***username*** with your account username:

```
$settings['redis.connection']['interface'] = 'Predis';
$settings['redis.connection']['host'] = '/home/username/.redis/redis.sock';
$settings['redis.connection']['port'] = NULL;
$settings['cache']['default'] = 'cache.backend.redis';
$settings['container_yamls'][] = 'sites/default/redis.services.yml';
```

<Tip>
  For additional information about these options, see the *modules/contrib/redis/README.md* file.
</Tip>

3. Save your changes to the *settings.php* file. Redis is now configured for Drupal.

<Tip>
  To verify that Drupal is working correctly with Redis, on the top menu bar of the administration interface, click\
  **Reports** , and then click\
  **Redis** . You should see a\
  **Connected, using the Predis client** message, along with statistics about the Redis cache and connection. If you see a\
  **Not connected** message, then Redis is not integrated with Drupal.
</Tip>

## More information

For more information about Redis, please visit [https://redis.io](https://redis.io).

## Related articles

* [Configuring Drupal to use memcached](/docs/configuring-drupal-to-use-memcached)

* [Using Redis on managed servers](/docs/using-redis-on-managed-servers)

* [Do you support Redis?](/docs/do-you-support-redis)
