Docker upgrade NC from 14 to 15


I run NC using Docker Compose.

I am currently using “latest” as version for the NC container.

I pulled the new NC version hoping that everything would continue to work without any other particular update procedure. is that a reasonable expectation?

after pulling my NC is not working… its complaining about db credentials.

any idea what is going on?

where was/is the config.php? inside the container? or on the host filesystem?

it is inside the container.

I can see that there is a custom.config.php with smtp settings only that’s outside of it.

php fails related to DB connection for user “oc_admin” however my POSTGRES_USER environment variable is “postgress”

looks like it is ignoring env vars, perhaps using defaults?

that’s the wrong place. nothing that is changed during operation is allowed inside a container.
if you don’t put /var/www/html in a volume all your changes to your nextcloud will be gone with that container.


that indicates (to me) that in the new container the initial setup didn’t run. and you have a strange state. you have no config.php but you have a postgres database. so the initial setup fails because it can’t create the database. as far as i remember that is not cover by the script.

yes, I have a volume for /var/www/html
then i am mounting a custom.config.php with mail settings only.
everything else is provided by the pulled image.

I think I have followed the examples /documentation properly

so do you have still the old config.php? what happens if you put this one in place (var/www/html/config/config.php)?

I see.

NC documentation says that the data volume is /var/www/html

However the image-dependent config.php is actually stored within the data volume in /var/www/html/config.

This basically means that pulling an update is never going to work unless you update your data volume with files distributed in the new image.

do you think this is what is happening?

but it is strange. I read the documentation again and this is the way it is supposed to be. an update process should have been triggered.

and I can see the following line in config.php
‘version’ => ‘’,

custom.config.php is mounted as:

so, I think it should not interfere with

a script is doing this for you. when you look at the script of the nc docker image you’ll see that the update is done in that script (if needed). the script copies the nextcloud php files from /usr/src/nextcloud/ to /var/www/html/ with an rsync command.

in the file upgrade.exclude you can see what is not synced because these are user created/modified files. and therefore should not be over written. in line 49 the script checks if the directories exists and creates them if needed.

that looks bad. if config.php isn’t writeable by nextcloud you can’t do any changes to your nextcloud (that are store in the config.php) that includes update to another version.

hope that helps you find out the right configuration.

I am not getting it to work
I tried to stop mounting any custom settings and trigger the update script again, by modifying the versions.php and leaving it as 14.0.0

still keeps trying to connect to the database with a default username ignoring the environment variable. Unfortunately I have very little time to put on this.

I find very troubling that my data volume includes, basically, the whole nextcloud PHP code. this is not the idea behind the volumes. Being able to replace the container image while keeping the data is a key benefit of docker.

I am going to wipe the data volume and get a fresh install, as I have no data of value, I am mostly testing the viability of replacing my Synology by Nextcloud.

I will open a but with NextCloud.

thanks for your help!