Docker-based update wipes the apps folder

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 32.0.2
  • Operating system and version (e.g., Ubuntu 24.04):
    • Raspbian trixie
  • Is this the first time you’ve seen this error? (Yes / No):
    • No, it happens every update
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Docker image nextcloud:fpm-alpine

Summary of the issue you are facing:

Following the documented update method, I pull the latest version of the Docker image nextcloud:fpm-alpine, then rebuild my own derived image and recreate the container with docker-compose up --build -d

The env variable NEXTCLOUD_UPDATE is set to 1 in order to trigger the update procedure in /entrypoint.sh, which copies the codebase from the image path /usr/src/nextcloud to the Docker volume mounted in /var/www/html.

After the update, all apps installed via the web interface are gone and have to be reinstalled.

As far as I can tell, this is because the update procedure is coded to exclude the folder /var/www/html/custom_apps/ from being overwritten (via the exclusion list at /upgrade.exclude), but when I install apps in the web interface, they are installed to the folder /var/www/html/apps, which is not excluded, and which gets overwritten by the rsync –delete command.

I suspect that my installation is somehow misconfigured and should be installing apps to custom_apps/ instead, but I don’t see how to change this or why it’s not the default.

Steps to replicate it (hint: details matter!):

[See above]

please review https://github.com/nextcloud/docker/?tab=readme-ov-file#additional-volumes

Data inside the main folder (/var/www/html) will be overridden/removed during installation and upgrades, unless listed in upgrade.exclude. The additional volumes officially supported are already in that list, but custom volumes will need to be added by you. We suggest mounting custom storage volumes outside of /var/www/html and if possible read-only so that making this adjustment is unnecessary. If you must do so, however, you may build a custom image with a modified /upgrade.exclude file that incorporates your custom volume(s).

overwriting data in /var/www/html/apps is expected. removing additional apps not. right now I can’t say where additional apps are installed but they remain functional after upgrades with official image.

please add configs and logs as requested by support template

Correct. Did you by chance originally port your config from a non-Docker deployment? Because docker deployments automatically set up discrete apps_paths for this reason.

See the Nextcloud Docker: Migration from an existing installation for steps to be followed.

1 Like