I am running Nextcloud inside a Docker container using an FPM + Nginx setup. Everything is working except the web UI is not displaying any files, and I get the error:
“Could not load photos folder”
The files are present inside the Nextcloud data directory, and a manual scan with occ
detects them correctly:
docker exec -it --user www-data nextcloud-app php occ files:scan admin
Starting scan for user 1 out of 1 (admin)
+---------+-------+-----+---------+---------+--------+--------------+
| Folders | Files | New | Updated | Removed | Errors | Elapsed time |
+---------+-------+-----+---------+---------+--------+--------------+
| 5 | 52 | 0 | 0 | 0 | 0 | 00:00:01 |
+---------+-------+-----+---------+---------+--------+--------------+
File System Checks
Permissions and ownership appear to be correct:
root@runner01:/var/lib/docker/volumes/nc-zzmd_nextcloud_files/_data# ll data/admin/files/
total 17580
drwxr-xr-x 5 www-data www-data 4096 Mar 16 14:30 ./
drwxr-xr-x 3 www-data www-data 4096 Mar 16 14:30 ../
drwxr-xr-x 2 www-data www-data 4096 Mar 16 14:30 Documents/
-rw-r--r-- 1 www-data www-data 3963036 Mar 16 14:30 'Nextcloud intro.mp4'
-rw-r--r-- 1 www-data www-data 12975716 Mar 16 14:30 'Nextcloud Manual.pdf'
-rw-r--r-- 1 www-data www-data 50598 Mar 16 14:30 Nextcloud.png
drwxr-xr-x 2 www-data www-data 4096 Mar 16 14:30 Photos/
-rw-r--r-- 1 www-data www-data 197 Mar 16 14:30 Readme.md
Docker Compose / Portainer YAML Configuration
Here is my docker-compose.yml configuration:
networks:
default:
name: nc-zzmd
volumes:
nextcloud_files:
mariadb_data:
services:
mariadb:
image: mariadb:10.11
container_name: nextcloud-db
restart: always
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
environment:
- MARIADB_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD}
- MARIADB_DATABASE=nextcloud
- MARIADB_USER=nextcloud
- MARIADB_PASSWORD=${MARIADB_PASSWORD}
volumes:
- mariadb_data:/var/lib/mysql
networks:
- default
nextcloud:
image: nextcloud:fpm
container_name: nextcloud-app
restart: always
depends_on:
- mariadb
- redis
environment:
- MYSQL_HOST=mariadb
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_PASSWORD=${MARIADB_PASSWORD}
- PHP_MEMORY_LIMIT=512M
- PHP_UPLOAD_LIMIT=512M
volumes:
- nextcloud_files:/var/www/html
networks:
- default
nginx:
image: nginx:alpine
container_name: nextcloud-web
restart: always
depends_on:
- nextcloud
ports:
- "8080:80"
volumes:
- nextcloud_files:/var/www/html
- /mnt/nextcloud_data/zzmd/nginx.conf:/etc/nginx/conf.d/default.conf:ro
networks:
- default
NGINX Configuration
Here is my nginx.conf:
worker_processes auto;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
upstream php-handler {
server nextcloud-app:9000;
}
server {
listen 80;
root /var/www/html;
index index.php index.html /index.php$request_uri;
client_max_body_size 512M;
location / {
try_files $uri $uri/ /index.php$request_uri;
}
location ~ \.php$ {
fastcgi_pass php-handler;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
}
Steps Tried & Debugging Attempts
- Ran file scan manually →
occ files:scan --all
successfully detected all files. - Checked permissions → All files owned by
www-data:www-data
with correct permissions. - Checked Nextcloud logs → No errors in
/var/www/html/data/nextcloud.log
. (empty) - Checked database for ghost files → Ran
occ files:cleanup
. - Tried maintenance repair → Ran
occ maintenance:repair
. - Cleared browser cache and tried different browsers → No effect.
- Restarted containers → No change.
Questions:
- Why is Nextcloud detecting the files via
occ files:scan
but not showing them in the UI?
Any help or suggestions would be appreciated! Thanks in advance.