Clear Nextcloud’s File Locking Warning with Redis

To clear Nextcloud’s transactional file locking warning, first make sure locking is enabled, then configure a persistent Redis-compatible backend such as Redis or Valkey. On a small instance, Nextcloud can use its database locking backend by default; for a production server or shared workload, Redis-backed locking is the usual choice because it reduces lock traffic to the database. Do not assign file locks to Memcached: Nextcloud warns that cached values can disappear unexpectedly.

Choose the locking backend that fits your server

Transactional file locking protects file operations from conflicting writes and can release locks when an upload or other transaction is interrupted. It helps prevent corruption during normal operation, including work involving shared files and external storage. It does not prevent two people from editing the same document at once or provide presence indicators; it controls simultaneous saves. See the Nextcloud 35 transactional file locking documentation.

  • Database backend: Nextcloud uses database locking by default. It avoids adding another service and can be adequate for a small personal installation, but database locking adds load. If you are only clearing a warning on a lightly used server, first confirm that locking has not been explicitly disabled.
  • Redis with phpredis: A good fit for established single-server and clustered deployments. It requires a Redis-compatible server and the PHP Redis extension, plus matching connection settings in Nextcloud.
  • KeyValueCache with Redis or Valkey: Available starting with Nextcloud 34.0.2. It uses Nextcloud’s bundled library, so it does not require a PHP Redis extension. This is useful when the extension is unavailable, though Nextcloud notes that a remote key-value server can add network overhead.
  • Memcached: It can serve distributed caching, but it is not appropriate for transactional file locks because cache values may be evicted. Keep it out of memcache.locking.

For a small home server, database locking may be enough if there is no locking warning and no database pressure. Choose Redis or Valkey for busy instances, multiple application servers, or when you want file locks handled outside the database. The current Nextcloud 35 memory caching guidance recommends APCu for local cache and Redis for locking in common single-server deployments. Clustered web nodes must all use the same Redis or Valkey endpoint or cluster.

Check whether locking was disabled

Find the active Nextcloud configuration file, usually config/config.php under the Nextcloud installation directory. Back it up before changing it. Search for filelocking.enabled and memcache.locking. The configuration reference sets locking to enabled by default; if you find an explicit false value, change it to true or remove that override.

'filelocking.enabled' => true,

Do not add a second copy of an existing key. PHP configuration arrays should contain one effective value for each setting. If you use a container or managed hosting panel, make changes through its supported configuration mechanism so they persist after upgrades or redeployments. The Nextcloud 35 admin warning reference identifies the locking warning and links to the backend requirements.

Configure Redis locking on a single server

On Debian or Ubuntu, package names commonly look like redis-server and php-redis; use your distribution’s packages and match the PHP module to the PHP version used by the web server. If using the classic Redis backend, install and start the Redis service and confirm the PHP Redis extension is enabled for the web SAPI. A CLI-only PHP module does not prove PHP-FPM or Apache can load it.

Add the locking backend and connection details to the existing config.php array. This example assumes Redis is running on the same machine, listening on localhost port 6379, and accessible to the Nextcloud PHP process:

'memcache.locking' => '\OC\Memcache\Redis',
'redis' => [
    'host' => 'localhost',
    'port' => 6379,
    'timeout' => 0.0,
],

Set authentication details if your Redis server requires them. Avoid exposing Redis to the public internet; restrict it to the host or private network and configure authentication and firewall rules. For a Unix socket, use the socket path as the Redis host and port 0, and ensure the web server user can access that socket. Do not copy localhost settings into a multi-server deployment unless Redis is genuinely local and shared consistently; all Nextcloud application nodes need to address the same backend.

When the PHP Redis extension is unavailable

On Nextcloud 34.0.2 or later, KeyValueCache can connect to Redis or Valkey without a separately installed PHP extension. Configure the backend and key-value store as follows, replacing the host and any credentials with your environment’s values:

'memcache.locking' => '\OC\Memcache\KeyValueCache',
'memcache.kvstore' => [
    'server' => [
        'host' => 'localhost',
        'port' => 6379,
    ],
],

Do not configure both Redis and KeyValueCache as competing locking providers. Follow the Nextcloud documentation for credentials, TLS, sockets, Sentinel, or cluster topology rather than adapting a single-server example by guesswork.

Restart and verify the fix

Restart the Redis-compatible service if you changed its service configuration, then restart the web server or PHP-FPM process if you installed or enabled a PHP extension. Check service status using the service name for your distribution; for example, systemctl status redis-server on many Debian or Ubuntu systems. Confirm the service is active and that the PHP process can connect. Container deployments should use the Redis service name on the container network, not localhost unless both services share a network namespace.

Sign in to Nextcloud as an administrator and refresh the Administration overview. The transactional file locking warning should disappear when the configured backend is available and the setting is loaded. Upload, download, and sync a test file, then review the Nextcloud and PHP logs if a Redis connection or permission error appears. A warning that remains usually points to a typo, a duplicate configuration key, the wrong PHP extension/SAPI, a blocked network connection, incorrect socket permissions, or an unreachable backend. Correct that specific cause rather than disabling locking.

For deployment-specific options, consult the versioned official references before changing topology: Transactional file locking, Memory caching and Redis/Valkey configuration, and configuration parameters.

Leave a Comment

Clear Nextcloud’s File Locking Warning with Redis

Enable reliable Nextcloud file locking, choose the right Redis or Valkey backend, and verify the warning clears without risking concurrent file changes.

What It Takes to Target an A+ Nextcloud Security Rating

What It Takes to Target an A+ Nextcloud Security Rating

Fix common Nextcloud scan findings with current updates, HTTPS and HSTS, precise reverse-proxy trust, and checks against the public server.

Automate Consistent Nextcloud Backups with Restic and Cron

Automate Consistent Nextcloud Backups with Restic and Cron

Back up Nextcloud’s files and MariaDB together, schedule encrypted Restic snapshots with cron, and verify recovery without risking the live server.

Enable Nextcloud Server-Side Encryption with Measured Impact

Configure Nextcloud SSE for the storage that needs it, protect encryption keys, and measure transfer and CPU impact before encrypting existing files.

Add Elasticsearch Full-Text Search to Nextcloud

Connect Nextcloud’s file search to Elasticsearch, index document contents, and choose a setup that fits your server and security needs.

Set a Reliable Expiration Policy for Nextcloud Deleted Files

Set a Reliable Expiration Policy for Nextcloud Deleted Files

Configure Nextcloud to remove deleted files after a defined retention period, schedule background jobs reliably, and avoid commands that purge every user’s trash.

Clear Nextcloud’s Missing Database Indexes Warning

Clear Nextcloud’s Missing Database Indexes Warning

Run Nextcloud’s OCC repair safely, preview the database changes, and check why the warning might remain.

Raise Nextcloud’s Web Upload Limit Past 2 GB

Raise Nextcloud’s Web Upload Limit Past 2 GB

Allow larger Nextcloud browser uploads by aligning PHP, Nginx or Apache, temporary storage, and timeout settings—and verify which limit is blocking the file.

Clear Nextcloud’s PHP Memory Warning at the Web Server

Set the PHP memory limit Nextcloud actually uses, restart the right service, and confirm the 512 MB setting in Admin Overview.

Connect an S3-Compatible Bucket to Nextcloud External Storage

Mount a compatible object-storage bucket in Nextcloud using its S3 backend, with the right endpoint, credentials, access scope, and verification steps.