Suggestion for the installation process in Docker Compose

I’ve already installed NC on my docker host so this won’t really effect me. But it should help anyone trying to do the same in the future. There are edits I needed to make to the config/config.php file after the installation was completed. Things like trusted domains and setting it up to work behind an HAProxy.

It would be helpful if those kinds of edits could be made in the compose file and doing so would make them automatically become part of the config.php file.

If you hit specific issues you are welcome to share them so others could benefit from your findings.

In general this guide docker-compose-setup-with-notify-push-2024 allows very easy compose installation (reverse proxy part is missing so far, but it works when traefik is already setup on the system)

From my reading of the link you provided, if I had known before installing it, that I needed to edit the Trusted Domains, I could have edited the global.env file and it would have been in there from the initial install.

But I found out when I tried to load NC into my browser after installation and was greeted with a message telling me to edit this in config/config.php.

IMHO, anything that can safely be changed after installation just by editing the config.php file should be something I can put in the compose.yaml file. That way, I could edit the compose.yaml file and restart the container. Docker could edit the config.php file with the desired change (or does docker not allow that type of thing?).

Docker “itself” is supposed to work exactly this way.

Nextcloud container doesn’t completely follow this approach - some of the variables are only applied at the first start (maybe to avoid braking existing setups). What you see in NC UI is completely independet from the installation variant you are using - this is a generic message as the installation can not know if you are running Docker, Snap, VM or bare-metal - each of the integrations might have own ways to adjust most important settings, which in turn end on the application-visible config.php file…

I stopped the NC container, logged into the host (the one running docker), found the config.php file, made the edits and restarted the NC container. The message went away.

That leads me to believe letting the compose.yaml file make that change shouldn’t break anything. That’s all I was getting at.

But like I said, it won’t effect me because I’ve already got it up and running. I was trying to make it easier on others when they set up their system

All ENV variables supported in the image are well documented, I’m not sure what is the point when you didn’t read the docs and don’t even describe what is your desired improvement?

The one change that prompted this was the need to modify the trustee domains. I only found out about it when the login page didn’t show up and instead told me I needed to change the config/config.php file.

I didn’t read about how to do it because I didn’t know I needed to make such a change – it so I didn’t look for how.

Prior to installing NC, I watched several different videos showing how people had installed it. And also read a few blog entries on the subject.

None of them mentioned it.

There are edits I needed to make to the config/config.php file after the installation was completed. Things like trusted domains and setting it up to work behind an HAProxy.

It would be helpful if those kinds of edits could be made in the compose file and doing so would make them automatically become part of the config.php file.

That’s already the case unless I’m misunderstanding your post. trusted_domains gets populated via the NEXTCLOUD_TRUSTED_DOMAINS variable in Compose. I use it routinely. Have you seen the actual documentation for the Docker image?

That is, assuming you’re even using that image. You didn’t specify which Docker image you’re using.

I’m using portainer to manage containers. Within the portainer UI, it asked for an image. I entered Linux server/NextCloud:latest. After setting up the voles and the two ENV vars (PUID & PGID), I deployed NC.

Docker is hosted at 10.10.0.10. That is the IP Address that config/config.php listed in trusted domains. But I’m trying to setup HAProxy to point nc.home.mydomain.com at NextCloud. When I tried to browse to that address, I was greeted with the message telling me I needed to edit the config file.

You’re using a third-party image. That’s not one of the images provided by the Nextcloud project[1] itself. You’ll need to check their documentation and/or their forum possibly: nextcloud - LinuxServer.io

[1] Those images would be:

1 Like

That explains the confusion then.

Is there anything wrong with this image? Would it be worth changing (other than setting up my individual user and adding some apps), I haven’t done much with it yet.

I’ve been focusing on gett the proxy set up to work with it along with poking around in the UI to get a feel for it.

1 Like

Not really, the Linux server containers are a well known and trusted group of packagers.

Their main advantage/disadvantage is they have a common container build layout for all the projects they package. It can make it easier to manage but there are several edge cases for each project.

I also know that the upgrade cycle between major Nextcloud versions tends to be more error prone than the Microservice and AIO. Nothing major, but you are more likely to need to drop to the CLI to run an OCC command in my experience.

2 Likes

Other than not knowing what you mean my OCC, that all sounds tolerable.

Thanks for the info.

It’s the nextcloud CLI interface, it’s very useful to know about.

https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html

1 Like

Gotcha. I’ve used the console. I just never heard of that notation before.

Thanks for your time. I am had no idea I wasn’t using the official NC image. I’m very new to the docker world and though this image was maintained by the NC team.