Kualo / docs
On this page

How to enable Redis Cache via Unix Socket on Moodle

Configure Moodle to use Redis for session caching via a Unix socket on your Kualo hosting account.

1 min read Updated 4 Jun 2026

Connecting Moodle to Redis via a Unix socket gives you faster, more efficient session handling than a TCP connection. This guide walks you through the three steps needed to get it working on your Kualo account.

Step 1: enable your Redis instance in cPanel

Before touching Moodle, you need to start a Redis instance in cPanel. Follow the instructions in Enable Redis Unix Socket to do that.

Step 2: update config.php

Once your Redis instance is running, add the following lines to your Moodle config.php file. Replace USERNAME with your cPanel username.

$CFG->session_handler_class = '\core\session\redis';

$CFG->session_redis_host = '/home/USERNAME/.kxcache/redis.sock';
$CFG->session_redis_port = -1;              // Use -1 for a Unix socket; omit for TCP
$CFG->session_redis_database = 0;           // Optional - default is database 0
$CFG->session_redis_prefix = 'sess_';       // Optional - default is no prefix
$CFG->session_redis_acquire_lock_timeout = 120;
$CFG->session_redis_lock_expire = 7200;
$CFG->session_redis_serializer_use_igbinary = true;

The last line enables the IGBinary serialiser, which is faster and more memory-efficient than PHP's default serialiser. To use it, you must enable the igbinary extension in the PHP Selector in cPanel. If you prefer not to use IGBinary, simply remove that line and Moodle will fall back to the PHP default serialiser.

Step 3: configure the Moodle cache store

With the session handler in place, you also need to add Redis as a cache store inside Moodle itself. Follow the official Moodle documentation for the Redis cache store to complete this part of the setup.

If you have any questions, do not hesitate to contact us.

Was this helpful?
Your feedback helps us find gaps in the docs.
Still need a hand?
Real people, around the clock - start a chat or open a ticket and we'll help you put it right.