Nextcloud docker fpm not showing items in data folder

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

  1. Ran file scan manuallyocc files:scan --all successfully detected all files.
  2. Checked permissions → All files owned by www-data:www-data with correct permissions.
  3. Checked Nextcloud logs → No errors in /var/www/html/data/nextcloud.log. (empty)
  4. Checked database for ghost files → Ran occ files:cleanup.
  5. Tried maintenance repair → Ran occ maintenance:repair.
  6. Cleared browser cache and tried different browsers → No effect.
  7. 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.

The first thing I notice is that you have a very incomplete configuration for Nginx with Nextcloud.

See:

1 Like

side question, just because I have my compose file here

I have redis installed and working on the same network as NC container, I confirmed it’s working

root@runner01:/var/lib/docker/volumes/nc-zzmd_nextcloud_files/_data# docker exec -it nextcloud-redis redis-cli -a <redacted> ping
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
PONG

here’s my NC container

  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}
      - REDIS_HOST=nextcloud-redis
      - REDIS_HOST_PASSWORD=${REDIS_PASSWORD}
      - REDIS_PORT=6379
    volumes:
      - nextcloud_files:/var/www/html  # just for the purpose of simplicity
    networks:
      - default

why my config.php still has
‘memcache.local’ => ‘\OC\Memcache\APCu’,
?

What about occ config:list system?

See Nextcloud Docker: Viewing the Configuration

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.