What the message looks like
Your data directory is readable by other users. Please change the permissions to 0770 so that the directory cannot be listed by other users.Common causes
- The data directory has 0755 or 0775 instead of 0770, e.g. after a restore or
cp -r. - A new data directory was created as root and opened with
chmod 755only. - A CIFS/SMB or NFS mount presents fixed permissions that
chmodcannot change. - Docker volume with wrong UID/GID or permissions from the host.
Check
- Read the data directory path from the config
sudo -u www-data php /var/www/nextcloud/occ config:system:get datadirectory - Show permissions and owner
stat -c '%a %U:%G %n' /var/www/nextcloud/data - Check filesystem and mount options
findmnt -T /var/www/nextcloud/data -o TARGET,FSTYPE,OPTIONS
Fix
- Set permissions:
chmod 0770 /var/www/nextcloud/dataand ownerwww-data:www-data. - For CIFS mounts set permissions via mount options:
uid=www-data,gid=www-data,file_mode=0770,dir_mode=0770. - For NFS set permissions on the server, not the client.
- Only if the filesystem cannot do Unix permissions:
'check_data_directory_permissions' => falsein config.php – knowing the check is then gone. - Always check owner and permissions after restores.
Typical scenario
After moving to a new server, the data directory was copied with rsync -a as root and then 'repaired' with chmod -R 755. On access, 'Your data directory is readable by other users' appears, and older versions even refuse to start. Run stat -c '%a %U:%G' /srv/nextcloud/data to see the current permissions and owner. The directory should belong to the web server user and not be readable by others.
FAQ
Is it enough to change only the top directory?
For the warning, yes – the check looks at the data directory itself. Files below should still belong to the web server user.
Why 0770 and not 0750?
Both work. Nextcloud only requires that “others” have no access. 0750 is stricter if the group does not need to write.
Why does Nextcloud check the permissions of the data directory?
All user files live there. If other system users, such as further web applications on the same server, can read it, a vulnerability in another application would be a direct path to other people's files.
Is chmod 770 on the top directory enough?
The check concerns the data directory itself, for which 0770 or stricter is enough. The owner still has to be right: files inside should belong to the web server user, otherwise uploads and background jobs may fail.
Where should the data directory live?
Outside the web root, for example under /srv/nextcloud-data. It is then never directly reachable over HTTP, even if a web server rule is faulty. The path is set in config.php under datadirectory.