How to setup redis cache on php 8.1?

Hi, so my system is:
VPS: ARM64, 4cpu/8GB RAM
Ubuntu 22. Installed NC via Hestia CP. Running on PHP 8.1. Could someone help me, with how to set up the Redis cache? Thanks.
Redis is running successfully on my WordPress sites.

It’s in the docs:

It sounds like you’ll probably already have the PHP redis extension installed and enabled in your PHP if you’re already using it. So it’s just a matter of configuring your Nextcloud instance to use it in your config.php by adding/adjusting as follows:

'memcache.local' => '\OC\Memcache\APCu',
'memcache.distributed' => '\OC\Memcache\Redis',
'memcache.locking' => '\OC\Memcache\Redis',
'redis' => [
     'host' => 'localhost',
     'port' => 6379,
1 Like

for little more performance you also could use the unix sock

nextcloud config.php like this

  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/PATH/TO/YOUR/redis.sock',
    'port' => 0,
    'dbindex' => 0,
    'timeout' => 1.5,


In my case path is

but also could be

1 Like

yes, but I getting 500 internal error

concerning “redis” ?
Have you tried to set up config.php without redis (just APCU) and then restart of webserver for NC
Does the 500 internal error occur again?

All php modules installed?
All redis services
→ redis.service
→ redis-sentinel.service
are up and running?

redis connectable via … ??

a) socket
redis-cli -s /var/run/redis/redis.sock

redis-cli -h -p 6379

WordPress sees Redis cache, so thinking that all modules are running. Connecting Redis via port 6379.

‘memcache.local’ => ‘\OC\Memcache\APCu’,
‘memcache.locking’ => ‘\OC\Memcache\Redis’,
‘filelocking.enabled’ => ‘true’,
‘redis’ =>
array (
‘host’ => ‘’,
‘port’ => 6379,
‘timeout’ => 0.0,
‘password’ => ‘mypass’,


For future reference, when you get 500 errors with Nextcloud, the answer will always be in your nextcloud.log located in your NC datadirectory. That’s the place to start when troubleshooting.

1 Like