Docker + Nextcloud + External storage

  • Great, th'as up and running, now ;) The certificate is valid and my browers and other apps are happy!


    Thank you again for the help and the great job with all those docker add-ons! Sorry if I missed some information in the docs sometimes, but one can admit that there are a lot of sources of information: your website, readme files, multiple forum posts here... And some of them are outdated, so it is quite hard for a beginner to find the right information.

  • Hi,


    Now I'm facing anothher issue. I would like to access my Nextcloud instance via (for example) https://www.domain.duckdns.org:2222.

    For that, I've forwarded port 2222 to port 443 on my router, as Nextcloud and letsencrypt are accessed on port 443. But it doesn't seem to be sufficient, I've got a timeout error when trying to access Nextcloud on port 2222 and even from my local network.


    Where am I wrong? Do I have to change some settings somewhere on nextcloud and/or letsencrypt? Or even to rebuild the containers?


    Thanks

  • Nextcloud has its own auto redirects for security purposes and you'll have to modify those in it's config file. You may have to do other stuff on the nginx side but I'm not sure.


    All of that automation was done for port 443, ymmv with a custom port

  • Hi,


    I'm back with a new tiny problem. My setup works perfectly: Nextcloud installed as a Docker component on Librelec, accessible from everywhere via my Duckdns domain and certified with letsencrypt. I also have cron tasks running everyday in order to backup my Nextcloud calendars. However, those cron tasks are actually cUrl commands which download an ICS file from my own Nextcloud instance. Unfortunately, I've discovered that those curl commands don't reach their targets because of a time out error, as described on this output:


    Code
    LibreELEC:~ # curl -v -k -u <username>:<password> -o <destination> https://<domain:port>/remote.php/dav/calendars/<username>/personal?export
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
      0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying <ip:port>...
    * TCP_NODELAY set
      0     0    0     0    0     0      0      0 --:--:--  0:00:31 --:--:--     0* connect to <ip> port <port> failed: Connection timed out
    * Failed to connect to <domain> port <port>: Connection timed out
      0     0    0     0    0     0      0      0 --:--:--  0:00:31 --:--:--     0
    * Closing connection 0
    curl: (7) Failed to connect to <domain> port <port>: Connection timed out


    I've checked that I can access https://<domain:port>/remote.php/dav/calendars/<username>/personal?export from my browser and download the ICS file.

    I guess I could do something to make curl being able to download the file from my Raspberry and that it might be linked to the SSL certificate, but I can't understand how.


    Does anyone have an idea?


    Thanks

  • My guess is, it's due to curl when trying to connect to the domain, trying to go out the wan and try to come back in through the router and into the letsencrypt container.


    Assuming the cron tasks are running inside the nextcloud container, see if you can curl "https://localhost/remote.php/dav/calendars/<username>/personal?export" instead, so it tries to connect directly

  • Hey Alomon,


    i also want to install nextcloud as easy as its possible :-) I have tried it over the linuxserver.io repo but this will not work for me ... I hope may be you can help me. At the end i want mainly use KODI to watch tv and in the background i would like to run nextcloud. I have an raspbery 3b+ - and if that is not enough i will get a raspberry pi4 with 8gb.


    Can you maybe give me some informations and what is the easiest or best way to install nextcloud on KODI (LibreELEC)????

  • I have installed docker nexcloud twice, the first time with nginx and mariadb, and the second time with apache and mariadb. I have LE installed on an Intel i5 mini PC with 8GB RAM with plenty of power for the requirements. In spite of everything, nexcloud works with an unacceptable slowness. I may not have applied enough tweaks but I think nextcloud is not made for home use, I will continue to use syncthing because it works great with any processor!

    Edited once, last by elonesna ().

  • Hey Alomon,


    i also want to install nextcloud as easy as its possible :-) I have tried it over the linuxserver.io repo but this will not work for me ... I hope may be you can help me. At the end i want mainly use KODI to watch tv and in the background i would like to run nextcloud. I have an raspbery 3b+ - and if that is not enough i will get a raspberry pi4 with 8gb.


    Can you maybe give me some informations and what is the easiest or best way to install nextcloud on KODI (LibreELEC)????

    Hi,


    Sorry for the late answer. I recommend using these command lines to install Nextcloud, Mariadb and Letsencrypt: RE: Docker + Nextcloud + External storage


    Then, the procedure will depend on how you want to access Nextcloud, if you use a duckdns domain or not...


    To aptalca: what do you think about using a USB-powered external SSD with Nextcloud?

    In my mind, Libreelec, Docker and Nextcloud would still be installed on the RPi SD card, but this SSD would be added to Nextcloud external storages to host files. Would it be a problem that the SSD would not be immediately up when Librelec starts? Is the RPi USB enough to power the SSD correctly?


    Regards

    Edited 3 times, last by Alomon: Merged a post created by Alomon into this post. ().

  • It should be fine because the ssd should be mounted before docker starts. Rpi4 has enough power for an external ssd. Not sure about rpi3, but you can use a powered sata adapter worst case.


    Keep in mind that rpi4 can also boot from an external ssd, so no need to deal with the sd card at all. A sata adapter with uasp does wonders for overall speed.

  • I resume this old post because I was in the same situation:

    NTFS usb disk used with nextcloud docker (I know this is NOT the ideal solution but I was forced to use this filesystem)

    udevil mounts automatically with fmask=0133 and You can't change this behaviour because /etc/udevil/udevil.conf is in the read only part of the fs

    check_data_directory_permissions => false on nextcloud config is not the solution because user nobody doesn't have rights to write into the disk

    my solution was to make a udev rule to exclude standard udevil mount for only my particular disk and mount it using my parameters

    steps to reproduce it:

    1) copy real udev to the storage part

    Code
    cp /lib/udev/rules.d/95-udevil-mount.rules /storage/.config/udev.rules.d/

    2) modify this rule (in my case I wanted to do something different for every disk with label starting with string "Max")

    3) make a copy of service udevil-mount

    Code
    cp /usr/lib/systemd/system/[email protected] /storage/.config/system.d/[email protected]
    service

    4) modify service as follow

    Code
    [Unit]
    Description=Udevil mount service
    
    [Service]
    Type=oneshot
    ExecStart=-/storage/bin/mount_special_disk %I
    ExecStop=-/usr/bin/udevil --umount %I
    ExecStartPost=-/usr/lib/samba/samba-autoshare
    ExecStopPost=-/usr/lib/samba/samba-autoshare
    RemainAfterExit=yes

    5) create /storage/bin/mount_special_disk

    Bash
    #!/bin/sh
    disklabel=`/usr/sbin/blkid -o value -s LABEL $1`
    mkdir -p /media/$disklabel
    /usr/bin/mount -t ntfs -o nosuid,noexec,nodev,noatime,big_writes,fmask=0022,uid=65534,gid=100,utf8,permission $1 /media/$disklabel

    6) make script executable

    Code
    chmod a+x /storage/bin/mount_special_disk

    and that's all; every time a disk with label starting with "Max" is attached (I have 2 disks Max1 and Max2 all of them NTFS) it will be automounted in the same place of before, but with modified options so Nexcloud (or any other docker instance) can write to

    those scripts are far from ideal but they works, at least for my puposes...