Docker setup with custom apps

Hello all!

I’d love to switch to a docker setup for my nextcloud install, to allow easier maintenance, resilience and portability (using kubernetes, eventually).

I could not find any example of setup relying on the public docker image with custom apps installed. What is your preferred way to do it ?
The idea is not having to reinstall or enable apps from the interface, as k8s manages containers lifecycle itself.
I see 3 possible ways:

  • Have a volume mounted in the custom_apps folder with apps sources externally stored,
  • Running some occ app:install && occ app:enable commands
  • Pull sources of modules when building a custom image

I would personnally love relying on the public image without any building step, and pulling modules using the occ command line.

Would anyone have an example of this?
I already had a quick look at the examples from the docker repository but could not find any.

Thank you,


No idea ? No docker user out there ? :frowning:

I have been wanting to play with a NC docker + kubernetes setup… hopefully one day I will have time for this.

This was the main reason I started the NCP docker container, but the weight of the project keeps me busy.

I think I would build my own image, nothing wrong with that. In the NCP container right now the NC instance is in the volume, including its apps. I don’t know how k8 manages persistent volumes between instances that do not share storage. I would have to investigate that.

Please, share your progress!

I share the same problem. After docker pull I need two apps that I enable through OCI.
But how would I upgrade them without logging on to click the upgrade buttons?

I’m running a docker setup with nextcloud 13 on AWS ElasticContainerService (similar to a kubernetes cluster)

For the custom part (also for data) i’m using a mounted ElasticFileSystem (the ever-growing harddrive of AWS) - so far everything works fine… i only have two very stupid problems so far:

  1. the “occ app:install” or just simply any interesting command is not available right after server startup… -> the actual installation of nextcloud happens on first request … well, i can understand that… but even after a hacky INodeTable bash script which detects when the actual “config/config.php” is written and created (that’s when the installation happens)… even then the “occ whatever” commands are still not available… i ended up with stupid “wait for x seconds” approaches to get my occ commands running finally -.-

  2. as soon as i configure a “custom_apps” path into my mounted drive - it breaks the update process of official apps in nextcloud… beecause, as soon as i’m having a custom_apps folder setup, he starts to install everything in this mounted drive, not just the custom apps of the user… soo, when i update an official package, he will put the new data into my custom_apps folder, but is obviously still looking into the “nextcloud/apps” folder which is of course still in the old version then -.-

first one i can barely work around (but with nightmares)… second one seems to be a bad bug of nextcloud itself :-/ i try to open a separate support ticket for that

Actually after playing with kubernetes a bit more, I can now tell that 2 of the solutions first listed are not good.

  • Using a volume to mount application code is a bad idea, because then you have topic of versioning, keeping versions consistent, etc. -> Using volume to store applications now seems a bad idea to me. Volumes should be mostly (only?) configuration files (and app data?).
  • Installing the applications with occ command: seems like a bad idea too because it’s not in docker’s philosophy. Containers are supposed to be portable, if you need to pull code on top of your image and eventually compile it or any other treatment, you end up with lots of problems… Docker is supposed to be simple: pull an image, create a container, run the application. + there is the ‘command availability’ issue you describe, that I think I saw on my bare metal install at some point.

Therefore the only solution that feels right and “docker compliant” is actually to build my own custom image. Starting it from the official tagged image, pulling applications and packaging the whole thing.
If I need to add an application, I’ll have to rebuild my image, but at least that forces me to version the dockerfile. If I want to disable an app, I think there is a configuration file somewhere that I should be able to provide. The image will be a bit heavier, but at least there is no weird stuff going on. Stable execution code in a portable environment.

To be tested!

i try to open a separate support ticket for that

Did you create that ticket? Do you have a link to it?

Hi all,

actually, i run nextcloud within a kubernetes cluster and have to mount a persistent volume to achive this… It works, but is more like a “meh” solution. Is there still no better way to do this?

Is there a ticket?