Kilrah Posted August 11, 2022 Posted August 11, 2022 (edited) Project: https://nextcloud.com/ Original image: https://hub.docker.com/_/nextcloud Custom image used for this template: https://hub.docker.com/repository/docker/kilrah/nextcloud-ffmpeg What is Nextcloud? A safe home for all your data. Access & share your files, calendars, contacts, mail & more from any device, on your terms. Why yet another? There are several Nextcloud templates on unraid already, but none integrate ffmpeg to allow for video thumbnail generation and usage of the video conversion apps available in Nextcloud's App Store. The existing template for the official Nextcloud image is confusing and does not include some basic entries e.g. for the web port. The official image seems to be quite a bit faster than some 3rd-party builds. I'm hoping to be able to provide some extra tips and tricks in this support thread. It now also supports VAAPI for Intel and AMD video transcoding in the memories app, and includes PDLIB for the "Face Recognition" app. This template defaults to pulling my image that is built from the official "latest" image and additionally installs ffmpeg, no other change. Should you not care for that (ffmpeg adds about 450MB to the image) and just want an easy template it can also be used with the official image, just change "Repository" from "kilrah/nextcloud-ffmpeg" to "nextcloud". Basic installation: Change the Repository if needed Choose the port you wish to use for the web interface Choose your appdata directory should you wish something other than the default, this is where Nextcloud's code and configuration will live Choose your user data directory if desired. If you expect to store lots of data in your instance you will probably want to create a dedicated unraid share and select it there. Click Apply. The container will be created and started. Note that on the first run it may take a couple of minutes before the web UI is available. First steps: On the first access Nextcloud will have you create an admin account and select a database type. By default it will choose a SQLite database which requires no further configuration but as mentioned on the page is not recommended especially if you are going to use desktop clients. I use MariaDB-Offical: When going to install it choose a database name, user and password, create the container, and in Nextcloud's interface enter the same details, choosing your server's IP for "Database Host" instead of "localhost". If you already have a compatible database container that you wish to reuse you can use your favorite tool like phpmyadmin or adminer to connect to it and add a new database. Configuration tips: To use the video thumbnail capabilities nextcloud needs to be told to do so by enabling the relevant preview providers in its config file (in appdata/config/config.php), if you have Unraid 6.10+ and Dynamix File Manager you can edit it directly from the Unraid GUI. The relevant documentation is here: https://docs.nextcloud.com/server/22/admin_manual/configuration_server/config_sample_php_parameters.html#previews The config.sample.php that is present in the same folder is well documented and also a good reference. You might want to define a larger than default preview_max_memory if needed, along with increasing the PHP memory limit with -e PHP_MEMORY_LIMIT=XX in the template's Extra parameters. I use 1G for both to be sure previews can be generated for huge images. My relevant config: 'enable_previews' => true, 'enabledPreviewProviders' => array ( 0 => 'OC\\Preview\\TXT', 1 => 'OC\\Preview\\MarkDown', 3 => 'OC\\Preview\\Image', 4 => 'OC\\Preview\\Photoshop', 5 => 'OC\\Preview\\TIFF', 6 => 'OC\\Preview\\SVG', 7 => 'OC\\Preview\\Font', 8 => 'OC\\Preview\\MP3', 9 => 'OC\\Preview\\Movie', 10 => 'OC\\Preview\\MKV', 11 => 'OC\\Preview\\MP4', 12 => 'OC\\Preview\\AVI', ), 'preview_max_memory' => 1024, 'preview_max_x' => NULL, 'preview_max_y' => NULL, 'preview_max_filesize_image' => 400, Companion container: Project: https://github.com/rcdailey/nextcloud-cronjob Image: https://hub.docker.com/r/rcdailey/nextcloud-cronjob The official Nextcloud image needs an external trigger for its scheduled task processing. The Nextcloud-cronjob container is provided for this purpose. Install it making sure to specify your Nextcloud container's name correctly if you changed it from the default. Note that the cronjob container needs to be started after the main NC container, use startup order or rename as required. Then make sure "Cron (Recommended)" is selected for the Background Jobs option in your nextcloud instance's Basic Settings. It can be used for other Nextcloud containers provided the settings are set appropriately in the Advanced section. For example with the LSIO container: Set NEXTCLOUD_EXEC_SHELL to sh Set NEXTCLOUD_EXEC_USER to abc Create a folder mapped to Scripts path and place a script e.g. lsio.sh in it, containing php -f /config/www/nextcloud/cron.php Updates: One confusing thing with the official Docker image is that Nextcloud will notify you when a new version is available and tell you to go to settings and use the "Open Updater" button, but this does nothing. For some reason they have not hidden it in the Docker environment, but disabled its functionality with new versions actually being provided through container updates. It usually takes a couple of days for a new container to be published after the availability of the Nextcloud update so we just have to live with the notification in the meantime. Running occ commands in the container: Use Unraid's terminal and run the command like docker exec -u 33 Nextcloud-ffmpeg sh -c "php occ maintenance:mode --on" Of course replacing the container name if you used something else. Hardware transcoding support: Add an extra Device to the template, "/dev/dri" then run Memories' occ video configuration command. Of course you need the driver plugin for your Intel/AMD GPU plugin installed on Unraid. Support for Intel may be limited to 10th gen and older, don't have anything to validate. Edited July 24, 2024 by Kilrah 2 Quote
Kilrah Posted August 11, 2022 Author Posted August 11, 2022 (edited) Performance tweaks Using cache as appdata mountpoint If you have an SSD cache and it is big enough to hold the appdata (up to about 2GB if you have the user data separate, depends on installed apps), it helps to set the Application data path to /mnt/cache/xxx instead of /mnt/user/xxx. The template defaults to user for compatibility. Since Unraid 6.12 the recommended solution is to use the Exclusive share feature. Enable it in global share settings, set your appdata share to be on pool only and make sure the share only exists on said pool. That will cause /mnt/user/appdata to be accessed directly with no performance penalty. Using Redis Using Redis for caching can improve browsing responsiveness pretty significantly. I'm using the official container using the jj9987 template: Install it, then add the following to your nextcloud config.php: 'memcache.distributed' => '\\OC\\Memcache\\Redis', 'memcache.locking' => '\\OC\\Memcache\\Redis', 'redis' => array ( 'host' => 'server_ip', 'port' => 6379, 'password' => 'redis_password', ), substituting IP / password as necessary. Edited July 2, 2024 by Kilrah 1 Quote
pross Posted August 14, 2022 Posted August 14, 2022 Fresh install of the app After adding uername and clicking install Error Your data directory is readable by other users. Please change the permissions to 0770 so that the directory cannot be listed by other users. Quote
Kilrah Posted August 14, 2022 Author Posted August 14, 2022 (edited) Is that with a separate data share? What DB? I just tried setting a fresh copy both with and without a separate data share and sqlite and didn't get any error Edited August 14, 2022 by Kilrah Quote
Masterwishx Posted October 8, 2022 Posted October 8, 2022 Nextcloud-cronjob working with nextcloud from linuxserver ? Quote
Kilrah Posted October 9, 2022 Author Posted October 9, 2022 I would expect it to, give it a try and look at nextcloud-cronjob's log output, it should be pretty clear whether it's happy or not, then confirm on nextcloud's basic settings page. 1 Quote
Kilrah Posted October 12, 2022 Author Posted October 12, 2022 On 10/8/2022 at 2:40 PM, Masterwishx said: Nextcloud-cronjob working with nextcloud from linuxserver ? I just tried it on a fresh LSIO install, and it does work albeit with some tweaking. I added the necessary option to the template and instructions to the first post. That said the built-in cron in the LSIO container should work just fine on its own... don't know what makes it break so often on updates. Was also a reminder of how ungodly slow it is 1 Quote
Masterwishx Posted October 14, 2022 Posted October 14, 2022 On 10/12/2022 at 7:52 PM, Kilrah said: I just tried it on a fresh LSIO install, and it does work albeit with some tweaking. I added the necessary option to the template and instructions to the first post. That said the built-in cron in the LSIO container should work just fine on its own... don't know what makes it break so often on updates. Thanks for your work, i will check it when will have more time ... for now, i just using the simple script in user scripts for update apps only 'docker exec -i nextcloud occ app:update --all' but for more cron stuff need more scripts or your container ... Quote
Kilrah Posted October 25, 2022 Author Posted October 25, 2022 Nextcloud 25 is now out, but given that as usual with major releases s bunch of apps are not compatible yet I'll keep the latest tag on 24. If you want to upgrade you can change repository in the template to kilrah/nextcloud-ffmpeg:25. For more version info see the 2nd post in the thread. Quote
thebrotherhoodnas Posted October 28, 2022 Posted October 28, 2022 On 10/25/2022 at 10:55 AM, Kilrah said: Nextcloud 25 is now out, but given that as usual with major releases s bunch of apps are not compatible yet I'll keep the latest tag on 24. If you want to upgrade you can change repository in the template to kilrah/nextcloud-ffmpeg:25. For more version info see the 2nd post in the thread. Wouldn't it be best to keep it on the same version as the official Docker image? IIRC Nextcloud doesn't support downgrading, so a user wouldn't be able to switch from the official image to this version unless they specify the 25 tag. Quote
Kilrah Posted October 28, 2022 Author Posted October 28, 2022 (edited) I think there's no perfect solution like on most of the major upgrades... a conscious user should already not be on latest on the official one for that precise reason, it may be updated to a new version with breaking changes at anytime with no warning. I'd think favoring existing users of this container is more important, and I used not to have the specific version tags until last post so latest was all they had to choose from. I've added the version note to dockerhub. A few of the apps I use have been upgraded in the past couple of days so the transition period shouldn't be too long. One of my most important ones doesn't though... Edited October 28, 2022 by Kilrah 1 Quote
kftX Posted November 23, 2022 Posted November 23, 2022 (edited) <initial issue fixed, new issue however.> EDIT 2: Second issue also fixed, it was my HTTPS everywhere add-on for firefox messing with nextcloud, all is running and working. Now I just need to get the reverse proxy working and should be good! Edited November 24, 2022 by kftX both issues fixed. Quote
Kilrah Posted December 3, 2022 Author Posted December 3, 2022 As a heads up, I'll flip latest to 25 when 25.0.2 is released in a few days 1 Quote
bluepoet Posted December 8, 2022 Posted December 8, 2022 (edited) Not sure what to post in here. I am trying to get cron jobs setup for Nextcloud in Unraid. I thought I had the settings in but Nextcloud keeps saying jobs are not running and looking at the logs it doesn't appear things are working as well. I know you are going to want to see something, tell me what and how to get it to you and I can do that. One error that keeps popping up in the app logs is this Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [14] unable to open database file in /var/www/html/lib/private/DB/Connection.php:139 So - I got past that error and now I am getting the following, I am guessing there is a path variable that I am missing ------------------------------------------------------------- Executing Cron Tasks: Thu Dec 8 01:24:00 UTC 2022 ------------------------------------------------------------- > Nextcloud Container ID: 2057ca735f0d > Running Script: ./run-cron-php.sh Could not open input file: /var/www/html/cron.php > Done Edited December 8, 2022 by bluepoet Quote
Kilrah Posted December 8, 2022 Author Posted December 8, 2022 Please clarify your exact setup, which container(s), tag if any, what kind of database you're using etc... Quote
bluepoet Posted December 8, 2022 Posted December 8, 2022 (edited) I have tried all three versions of the next cloud - my container name is Nextcloud, for the database I finally installed is mariadb. The version of nexcloud I have currently is the official version by knext666's repository. This is also through unraid. I am no opposed as well to remove everything and start from scratch again. I think permissions are all off on things now as well. Edited December 8, 2022 by bluepoet Quote
bluepoet Posted December 8, 2022 Posted December 8, 2022 I got it working - I have to create a shared drive and then I installed everything to that drive and the magic started to happen Quote
darkangelus Posted December 10, 2022 Posted December 10, 2022 Hi, how would I go about fixing: > Running Script: ./run-cron-php.sh Cannot write into "config" directory! This can usually be fixed by giving the web server write access to the config directory. Thanks. Quote
TuxWolfgang Posted December 11, 2022 Posted December 11, 2022 The new version supports object recognition, but requires Node.js. Is there a way to make this work? https://apps.nextcloud.com/apps/recognize https://nextcloud.com/blog/press_releases/nextcloud-hub-3-release-ai-photos/ 1 Quote
Kilrah Posted December 11, 2022 Author Posted December 11, 2022 The app comes with its own bundled nodejs and as far as I can see already works fine that way. Quote
bluepoet Posted December 13, 2022 Posted December 13, 2022 (edited) So i have another issue that came up, well two and not sure how to resolve them. I tried to follow the documents but with it in a docker - the commands just dont work. Issue 1: Have a ton of image files on my server and some movie files as well from like phone video recordings. Some pictures will show an thumbnail image, others do not and the video files never show any images. I upped my memory cache to 1G which at least allows me to open the files, before it wouldn't even do that. Any way to get the thumbnails to come up for the other files? Issue 2: Picture files are very slow to load up, any way to speed that up? Issue 3: It said there was an update, I updated and now I am getting a database is missing indexes and it says to run a command to fix it. Tried to run the command but it doesn't work, any suggestions on how to fix this. Any help would be appreciated. Running unraid 6.11.5, Ryzen 5, 5600 with Radeon Graphics, 8 GB ram which I am thinking of bumping that up. Also for the cron job, should it be run more then every 15 minutes, is there any negative to doing it every minute or 5 minutes per say? Edited December 13, 2022 by bluepoet Quote
Kilrah Posted December 13, 2022 Author Posted December 13, 2022 (edited) For video thumbnails you need to be using this container (kilrah/nextcloud-ffmpeg), you can put that in your template as repository instead of what you already have. That is the whole point of this container/thread. Then you need to enable video previews in nextcloud config, see first post. 6 hours ago, bluepoet said: Issue 2: Picture files are very slow to load up, any way to speed that up? If you're talking of generating the previews not really, if they're large images that's a lot of processing. There's a "preview generator" app in nextcloud apps that you can use to pre-generate them, might help. 6 hours ago, bluepoet said: Issue 3: It said there was an update, I updated and now I am getting a database is missing indexes and it says to run a command to fix it. Tried to run the command but it doesn't work, any suggestions on how to fix this. How to run commands in the container is mentioned at the end of the first post. 6 hours ago, bluepoet said: Also for the cron job, should it be run more then every 15 minutes, is there any negative to doing it every minute or 5 minutes per say? I have it at 5 minutes myself, should be fine. Edited December 13, 2022 by Kilrah Quote
TuxWolfgang Posted December 13, 2022 Posted December 13, 2022 On 12/11/2022 at 11:16 PM, Kilrah said: The app comes with its own bundled nodejs and as far as I can see already works fine that way. That's strange. It can not be found on me? root@ae995bd20a60:/# node -v bash: node: command not found In the Nextcloud settings you can also set a path to the Node.JS. I just don't know where that should be? Quote
Kilrah Posted December 13, 2022 Author Posted December 13, 2022 3 minutes ago, TuxWolfgang said: In the Nextcloud settings you can also set a path to the Node.JS. I just don't know where that should be? I installed the app and it just worked, this is what it set by default, the full path is needed: Quote
TuxWolfgang Posted December 13, 2022 Posted December 13, 2022 I don't understand. The file seems to exist, but cannot be executed: root@ae995bd20a60:/# /var/www/html/custom_apps/recognize/bin/node -v bash: /var/www/html/custom_apps/recognize/bin/node: No such file or directory root@ae995bd20a60:/# cd /var/www/html/custom_apps/recognize/bin/ root@ae995bd20a60:/var/www/html/custom_apps/recognize/bin# dir node x64.tar.gz root@ae995bd20a60:/var/www/html/custom_apps/recognize/bin# ./node -v bash: ./node: No such file or directory root@ae995bd20a60:/var/www/html/custom_apps/recognize/bin# /node -v bash: /node: No such file or directory root@ae995bd20a60:/var/www/html/custom_apps/recognize/bin# node -v bash: node: command not found Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.