Nextcloud with Letsencrypt using OMV and docker-compose - Q&A

  • Today i have looked into the problem a little further. I found out, that the nextcloud is working with the changed port. But my firefox does not keep the custom port number. So when the nextcloud wants to redirect me from "xyz.dyndns.com:145/nextcloud" to "xyz.dyndns.com:145/nextcloud/index.php/login" the port number is lost and it redirects to "xyz.dyndns.com/nextcloud/index.php/login" instead. If I manually add the port number afterwards everything works as expected and i can log in.


    Following your suggestion, I changed the port number in the config.php. Then I get a message, that I access the cloud on an untrusted domain, because the container still thinks it is on the usual port 443.


    Do you have any ideas how to fix this?


    Edit: I found a working solution.
    If I set the value
    "proxy_set_header Host $host:$server_port;"
    in the file proxy.conf file of nginx to
    "
    proxy_set_header Host $host:145;"
    the port number no longer gets lost. It is a little messy I guess, but for now I am fine with this.

  • I have nextcloud and letsencrypt running. Connecting external storages via SMB/CIFS works flawlessly so far. In my case there was no need to change the containers.


    Under authentification I chose User and Password. In OMV i have a user which is in the sambashare group and this user has access to the shared folder. Also my samba share has guests allowed.

    Seems to have the same conf...
    The only thing that is different is the custom network, I followed the techno-dad-life 'how-to' and I think I didn't understood utility of custom network.
    For now I Try to figure it out, and I will notice you if i find.


    A new error pops when I re-build a new lets-encrypt container :

    Code
    pkg_resources.ContextualVersionConflict: (cryptography 2.6.1 (/usr/lib/python3.7/site-packages), Requirement.parse('cryptography>=2.8'), {'PyOpenSSL'})


    I found the fix in linuxserver forum. See the 'drumstyx response at 20/11/2019 to fix this issue:


    -Connect to your lets encrypt container bash and:


    Code
    apk add gcc musl-dev libffi-dev openssl-dev python3-dev; pip install cryptography --upgrade

    French nooby User. Sorry for my English language mistakes, I'm not used to post on english forum

    • MB: Asrock QC5000m microATX with AMD 5050 APU / RAM : 16 gb HyperX, Case: Fractal Design Node 804
    • Storage : Kingston SSD 128go (for OMV) / 1x4Tb Seagate IronWolf, 1x4Tb WD Red, 1x200 Go Maxtor and 1x230Go Maxtor (old devices)
    • Docker CE (not the OMV plugin) : managed by Portainer , run JDownloader2, TeamSpeak3, NextCloud 20 etc
    • Locate / MySQL (db kodi, nextcloud) / SMB_CIFS
  • Using External Storages


    I'm having trouble using external storages under this setup. I can't add external shares via the Nextcloud interface - they just keep showing up with the red icon that suggests that the host is unreachable.


    I am also unable to access the network share from within the nextcloud docker container using the command line:



    Code
    root@MYMACHINE:~# docker exec -it nextcloud bash
    root@d9513a28f349:/# smbclient -L TARGETPC
    do_connect: Connection to TARGETPC failed (Error NT_STATUS_UNSUCCESSFUL)
    root@d9513a28f349:/#

    From outside of the nextcloud container, I cannot use the smbclient command at all - command not found.


    I'm not sure if this is an issue specific to this nextcloud setup, or if it is about networking or the broader OMV environment.


    Any tips would be appreciated.


    - Andrew

  • You have to take into consideration that docker container have limited ways to communicate with the outside world.


    The easiest way to implement external folders seems to bind mount the external directory with the - v flag.


  • I found my problem about external storage. It's a known bug since Nextcloud bumps to 17.0.1 version. If you're in 17.0.1 version, you should consider following:


    So, to fix the problem, go to your config volumes and edit this file:

    Code
    /apps/files_external/lib/Lib/Backend/SMB.php


    This value:

    Code
    Line 56:
    (new DefinitionParameter(‘timeout’, $l->t(‘Timeout’)))
    ->setType(DefinitionParameter::VALUE_HIDDEN)

    should be:


    Code
    Should be:
    (new DefinitionParameter(‘timeout’, $l->t(‘Timeout’)))
    ->setType(DefinitionParameter::VALUE_HIDDEN)
    ->setFlag(DefinitionParameter::FLAG_OPTIONAL),

    Don't forget the last comma !!

    I tried last evening, and now i'm able to configure external samba storage


    Please let me now if it help.


    See the source: nextcloud forum

    French nooby User. Sorry for my English language mistakes, I'm not used to post on english forum

    • MB: Asrock QC5000m microATX with AMD 5050 APU / RAM : 16 gb HyperX, Case: Fractal Design Node 804
    • Storage : Kingston SSD 128go (for OMV) / 1x4Tb Seagate IronWolf, 1x4Tb WD Red, 1x200 Go Maxtor and 1x230Go Maxtor (old devices)
    • Docker CE (not the OMV plugin) : managed by Portainer , run JDownloader2, TeamSpeak3, NextCloud 20 etc
    • Locate / MySQL (db kodi, nextcloud) / SMB_CIFS
  • Hi again,


    my Server is still running smoothly :)


    But I was wondering if you could help me with some 'update'-issues, I started wondering because of 'nextcry': https://nextcloud.com/blog/urg…y-issue-in-nginx-php-fpm/


    So the first thing I was wondering is: do I have nginx, I checked that in the docker file -> yes I do.
    The next thing I was wondering is: do I have the newest php-Version -> not sure. I don't know how to open the 'version.php' on that server, it will always redirect me. There is probably a better way, to find out, but I don't know how yet.
    Then I wondered: How to update the docker-file itself: did that with just building again 'docker-compose up -d' I think, but not sure :)
    Then I read, that sometimes there is a need to delete certain configs before restarting. Do I have to edit it all over again after that?


    I feel, that I should ask for advice before(!) I mess up my install..
    Well, what I am asking is: would you guys be so kind to help/to guide me?
    Where should I start, what should I do, what should I never do?
    or start with more focus: How do I check if I am save against 'nextcry'.


    I would appreciate it a lot.
    kriber

  • I set up everything like in your howto. I also successfully migrated my old database and got everything up and running. What I now want to achieve is to have the nextcloud container listen on a different port in the lan.
    So I first tried it with only mariadb and nextcloud running, leaving letsencrypt down. In the nextcloud container I exposed port 443 to port 445 on the host and tried to connect but to no avail. I always get too many redirects.


    Any idea, what I have to change in the nginx or nextcloud config to make this work?


    The optimal setup would be that the system is reachable via domain through the letsencrypt proxy and in addition via a different port in lan.


    I already tried to add my host ip to the list of trusted proxies, which did not seem to work.

  • I'm having an issue creating the admin account for nextcloud (final step of the guide).

    I get the following error:




    Quote

    ErrorError while trying to create admin user: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [1045] Access denied for user 'oc_cloudadmin'@'nextcloud.files_default' (using password: YES)


    I have verified nextcloud can talk to the mariadb. I verified the root account is functional on mariadb and has been granted permissions to the nextcloud database.

    I don't know why it won't create the necessary admin account.

    Any help would be highly appreciated.


    Disregard. Solved by creating a new admin (non-root) account for the db on MariaDb and using that account on the nextcloud wizard.

    Fractal Design Node 304:
    VMWare vSphere 6.5 | OMV4.x on Debian 9 (Stretch): Asrock H270M-ITX - i3-7100 - 16GB DDR4 - 1x 80GB vmdk on Samsung 960 EVO 250GB PCIe NVMe SSD (system drive) - 1x 120GB vmdk on Toshiba 450GB HHD (docker data) - 3x Seagate IronWolf 8TB HDD (RDM physical passthrough, RAID-Z1 Pool)

    Edited once, last by cipherbreak ().

  • @cipherbreak


    Did you do like this?
    https://help.nextcloud.com/t/e…for-a-linux-beginner/8292


    Something must have changed. Before it worked like described in the guide. When I played around it did not work anymore I had to use the approach in the link (same as you did, I think).
    If so, I need to update the guide.


    Thanks

  • Disregard. Solved by creating a new admin (non-root) account for the db on MariaDb and using that account on the nextcloud wizard.

    I'm having the same problem. Can someone please explain how I go about doing that ^^^. I'm new to this docker thing.


    Alright, I found the ">_Console" button in Portainer.


    Thanks

  • If you want to setup a new application in docker you can try to do it using docker-compose.
    There is also at least one tool to generate docker-compose files based on an existing installation. However, I have no idea how good it works.

    May I ask what's the name for this tool?


    I've set up most of my dockers manually with portainer but would like to create docker-compose files now for my existing setup in case something breaks.

  • First of all, thanks a lot for the guide and support from the forum guys.


    I want to reinstall Nextcloud using this guide (subdomain method) and I have a question:
    In the configuration file (config.php), is port 445 correct?
    Or should it be 443 (Nextcloud default port)?


    5.6.5-1 (Usul)
    HP ProLiant G7 MicroServer N54L AMD Turion II / 4GB
    Kingston SSDNow 200 30GB (OS), 4 x WD red 2TB SATA3 (Data)



  • This don't work for me. Any help. I still receive



    Code
    Error while trying to create admin user: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [1045] Access denied for user 'nxtcloudadmin'@'nextcloud.nextcloud_default' (using password: YES)

    EDIT (SOLUTION):

    sudo docker exec -it nextclouddb bash
    mysql -u root -p
    MariaDB [(none)]> CREATE USER 'user' IDENTIFIED BY 'password';
    CREATE DATABASE IF NOT EXISTS nextcloud;
    GRANT ALL PRIVILEGES ON nextcloud.* TO 'user' IDENTIFIED BY 'password';
    FLUSH PRIVILEGES;
    exit


    now, continue to nextcloud setup use user/password in mysql part

    = Fujitsu PRIMERGY TX1310 M3 • 2 x HDD 3.5" 4TB Western Digital Red • Windows Server 2019 • Hyper-V • OMV 5.x =

    Edited 2 times, last by macom: typo: "-uroot" ---> "-u root" ().

  • Hi
    First of all thank you for this guide.


    I ran into a problem.
    Everything went smoothly but after configuration of proxy step, I get Internal Server Error when I try to reach https://your.url/nextcloud
    Full erroe message:
    Internal Server Error
    The server encountered an internal error and was unable to complete your request.Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report. More details can be found in the webserver log.
    I'm running OMV 4.1.31 version.


    Can anyone help?


    EDIT:
    Dammit, I've messed up proxy file... It works fine. Thanks!

  • Trying to set up Popcorn hour transformer on OMV4 (rock64)


    Keep getting

    Bash
    "proxy_max_temp_file_size" directive invalid value in /config/nginx/proxy-confs/nextcloud.subfolder.conf:33


    What am I doing wrong?


    My config:


  • There's nothing wrong with your nextcloud docker. Rather with your nextcloud.subfolder.conf file. Change the "proxy_max_temp_file_size from 2048m to 1024m. That's what's worked for me.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!