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/htmland 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.excludefile 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