The default installation of Nextcloud on the Unraid container has APCu cache installed and configured in the config.php file. So, what can Redis do here? Redis has a more powerful caching mechanism than any other tools. In the context of Nextcloud, it can be used for file locking, caching, and more. So, read on to learn how to set up Redis on Unraid for Nextcloud.
The biggest advantage of file locking and caching is to reduce the load on the database. Large files or many files can increase the load on the database server, resulting in locks and slow queries, etc.
1- Install Redis
Log in to the Unraid instance and click on the Apps tab in the top menu. Search for Redis and click on the install button by choosing the official container. This will install Redis and set up the container. The default Redis access port is 6379, and the IP is the same as the Unraid instance. However, for confirmation, check the Redis container details.
And that’s it for the Redis installation—simple, and just a click did it.
2- Configure Nextcloud
Click on the Nextcloud container and choose Console. The default configuration file is located in /config/www/nextcloud/config/. Open it for editing with:
nano /config/www/nextcloud/config/config.php
Add the following to it and change the host IP to the actual IP of the Redis container.
'filelocking.enabled' => true,
'memcache.local' => '\\OC\\Memcache\\Redis',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'redis' =>
array (
'host' => 'IP',
'port' => 6379,
),
Save and close the console window.
You can now upload files via the desktop app or web UI without the fear of issues like file locking, etc. Besides that, your Nextcloud should be more responsive than before.