ubuntu – Nextcloud installed from docker. How do I download and install custom apps?
Perfect! As you are using the Container Image provided by Nextcloud themselves, you have a good time!
Just add another volume to you compose file that links to
/var/www/html/custom_apps and you should be good to go. See Persistent data in their docs.
You should NOT link the default app path with docker, since that means that an empty (or only with your apps populated) directory is linked into the container. But since NC is kind of a framework, even the file listing is an app – that will be missing, if you dont provide your on version!
As of March 2022 the Nextcloud container image has some apps pre-installed in
custom_apps. In my case mounting a
custom_apps directory overwrote the apps that were already installed there. I ended up adding individual apps as volumes rather than the whole directory. Heres an example docker-compose.yml snippet using the
backup app with your file structure in the main app Docker container:
volumes: - /data/ncweb:/var/www/html - /data/ncapps/backup:/var/www/nextcloud/custom_apps/backup
I had an issue where
www-data did not own this file in the Docker container so I modified the entry point for the container that manages the Nextcloud cron job to fix that:
#!/bin/bash # we need to chown the custom_apps folder in order to install custom apps chown -R www-data /var/www/html/custom_apps # run cron script, which is the default entrypoint for the cron usage of this image /bin/bash /cron.sh
Be sure to mount the volume and the bash script to the cron container and change the default entry point in docker-compose.yml:
volumes: - /data/ncweb:/var/www/html - /data/ncapps/backup:/var/www/html/custom_apps/backup - /cron-entry.sh:/cron-entry.sh entrypoint: /cron-entry.sh
Just to be clear, there are two Docker containers shown, one for the app and one for the cron job. This snippet of docker-compose.yml is for the cron container, the earlier snippet is for the app container. I noticed in your docker-compose.yml you dont have any mention of the cron container which might be something you want to look into. Nextcloud requires a cron process to run every 5 minutes to handle background tasks and Docker recommends having one process per container which is why I have a separate container just for the cron job. Im using the cron container to run my own entry script because it was easier to find and call that entry point.
Anyway, once thats done go to
/settings/apps/disabled in your Nextcloud app. You should be able to enable the app there.