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

  • Is a bug on tracker related to the new photos app. Quite nasty, since in shares photos won't open at all.

    It was supposed to be fixed with 19, but its still there. I wait day by day for a new release.

    Seems like the behavirour is still the same.

    I found this post: https://help.nextcloud.com/t/e…-to-your-photos-app/86921


    I suggests to install the old gallery app to make photos from external storage accessible with the photos app.

    Guess that is what i am heading to then.

  • Hello guys.. i followed the guide: but i don get it.


    1st of all some informations:


    OMV5, DuckDNS, domain: https://xxxxnas.duckdns.org (is a subdomain ??)




    here is my docker-compose:


    version: "2"

    services:

    nextcloud:

    image: linuxserver/nextcloud

    container_name: nextcloud

    environment:

    - PUID=1000

    - PGID=100

    volumes:

    - /srv/dev-disk-by-label-Daten1/dockerconfig/nextcloud/config:/config

    - /srv/dev-disk-by-label-Daten1/dockerconfig/nextcloud/data:/data

    depends_on:

    - mariadb

    restart: unless-stopped

    mariadb:

    image: linuxserver/mariadb

    container_name: nextclouddb

    environment:

    - PUID=1000

    - PGID=100

    - MYSQL_ROOT_PASSWORD=xxxx

    - TZ=Europe/Berlin

    volumes:

    - /srv/dev-disk-by-label-Daten1/dockerconfig/mariadb:/config

    restart: unless-stopped

    letsencrypt:

    image: linuxserver/letsencrypt

    container_name: letsencrypt

    cap_add:

    - NET_ADMIN

    environment:

    - PUID=1000

    - PGID=100

    - TZ=Europe/Berlin

    - URL=xxxx.duckdns.org

    - SUBDOMAINS=www,rumpelnas,

    - VALIDATION=duckdns

    - DUCKDNSTOKEN=123456789

    - EMAIL=xxxx@gmail.com

    volumes:

    - /srv/dev-disk-by-label-Daten1/dockerconfig/letsencrypt:/config

    ports:

    - 444:443

    - 81:80

    restart: unless-stopped





    I also use DuckDNS which u can see under environment:

    port forwarding 444-->443 and 81-->80 is also enabled..


    ----------------------------------------


    this is my config.php:


    <?php

    $CONFIG = array (

    'memcache.local' => '\OC\Memcache\APCu',

    'datadirectory' => '/data',

    'trusted_proxies' =>

    array (

    0 => 'letsencrypt',

    ),

    'overwritewebroot' => '/nextcloud',

    'overwrite.cli.url' => 'https://xxxxx.duckdns.org/nextcloud',

    'trusted_domains' =>

    array (

    0 => 'xxxxx.duckdns.org:443',

    );


    everything seems fine but if i go to https://xxxx.duckdns.org/nextcloud i get this error..




    Code
    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 don know where my fault is... can anyone help me ?

    Morlan

    ty

    MSI B-250-DS3H-G4560 | some RAM | someTB WD red (snapraid) | OMV 5.x (latest) | DD Cine S2 V6.5

    Edited once, last by Ruschi ().

  • Ruschi It all looks okay.

    What does your nextcloud.subdomain.conf file look like? Be sure to obfuscate your personal information.


    You may just need to clear your browser cache and reload your browser page.

    You may have tried to access your site too soon. It takes a while for the database to set up.

    Simple and sure backup and restore: In a Scheduled Job: rsync -av --delete /srv/dev-disk-by-label-SOURCE/ /srv/dev-disk-by-label-DESTINATION/ (HT: Getting Started with OMV5)
    OMV Version: Ver. 5 (current) - Hardware: NanoPi M4, Nextcloud, Plex, Airsonic, Booksonic, Calibre, & Heimdall - Acer Aspire T180, backup - Odroid XU4, Pi-Hole (DietPi) - Testing/Playing: hc2, xu4, Pi 3B+, Odroid H2, and HP dx2400, Debian 10 XFCE.

  • Ruschi It all looks okay.

    What does your nextcloud.subdomain.conf file look like? Be sure to obfuscate your personal information.


    You may just need to clear your browser cache and reload your browser page.

    You may have tried to access your site too soon. It takes a while for the database to set up.

    # Assuming this container is called "swag", edit your nextcloud container's config

    # located at /config/www/nextcloud/config/config.php and add the following lines before the ");":

    # 'trusted_proxies' => ['swag'],

    # 'overwritewebroot' => '/nextcloud',

    # 'overwrite.cli.url' => 'https://your-domain.com/nextcloud',

    #

    # Also don't forget to add your domain name to the trusted domains array. It should look somewhat like this:

    # array (

    # 0 => '192.168.0.1:444', # This line may look different on your setup, don't modify it.

    # 1 => 'your-domain.com',

    # ),


    # Redirects for DAV clients

    location = /.well-known/carddav {

    return 301 $scheme://$host/nextcloud/remote.php/dav;

    }


    location = /.well-known/caldav {

    return 301 $scheme://$host/nextcloud/remote.php/dav;

    }


    location /nextcloud {

    return 301 $scheme://$host/nextcloud/;

    }


    location ^~ /nextcloud/ {

    include /config/nginx/proxy.conf;

    resolver 127.0.0.11 valid=30s;

    set $upstream_app nextcloud;

    set $upstream_port 443;

    set $upstream_proto https;

    proxy_pass $upstream_proto://$upstream_app:$upstream_port;


    rewrite /nextcloud(.*) $1 break;

    proxy_max_temp_file_size 2048m;

    proxy_set_header Range $http_range;

    proxy_set_header If-Range $http_if_range;

    proxy_redirect off;

    proxy_ssl_session_reuse off;

    }


    this is still the sample. I didnt change it to nextcloud.subdomain.conf... in the guide he changes this:


    cp nextcloud.subfolder.conf.sample nextcloud.subfolder.conf


    and what i have see in the nginx-error log:


    2020/11/02 15:42:20 [error] 371#371: *11 FastCGI sent in stderr: "PHP message: PHP Parse error: syntax error, unexpected end of file, expecting ')' in /config/www/nextcloud/config/config.php on line 16" while reading upstream, client: 95.116.121.85, server: _, request: "GET / HTTP/1.1", upstream:$

    MSI B-250-DS3H-G4560 | some RAM | someTB WD red (snapraid) | OMV 5.x (latest) | DD Cine S2 V6.5

    Edited once, last by Ruschi ().

  • cp nextcloud.subfolder.conf.sample nextcloud.subfolder.conf

    You should be using nextcloud.subdomain.conf.sample not nextcloud.subfolder.conf.sample

    Hopefully that is the only thing amiss.

    Simple and sure backup and restore: In a Scheduled Job: rsync -av --delete /srv/dev-disk-by-label-SOURCE/ /srv/dev-disk-by-label-DESTINATION/ (HT: Getting Started with OMV5)
    OMV Version: Ver. 5 (current) - Hardware: NanoPi M4, Nextcloud, Plex, Airsonic, Booksonic, Calibre, & Heimdall - Acer Aspire T180, backup - Odroid XU4, Pi-Hole (DietPi) - Testing/Playing: hc2, xu4, Pi 3B+, Odroid H2, and HP dx2400, Debian 10 XFCE.

  • You should be using nextcloud.subdomain.conf.sample not nextcloud.subfolder.conf.sample

    Hopefully that is the only thing amiss.

    subfolder method is also viable.


    Ruschi

    What method do you want to use? Subfolder or subdomain. There is a limitation for the duckdns validation of the letsencrypt container. If you enter subdomains the cert is not working for the core domain. What is the output of the letsencrypt container log?

  • first of all: i started from Zero with this stack:



    version: "2"

    services:

    nextcloud:

    image: linuxserver/nextcloud

    container_name: nextcloud

    environment:

    - PUID=1000

    - PGID=100

    volumes:

    - /srv/dev-disk-by-label-Daten1/dockerconfig/nextcloud/config:/config

    - /srv/dev-disk-by-label-Daten1/dockerconfig/nextcloud/data:/data

    depends_on:

    - mariadb

    restart: unless-stopped

    duckdns:

    image: linuxserver/duckdns

    container_name: duckdns

    environment:

    - PUID=1000

    - PGID=100

    - TZ=Europe/Berlin

    - SUBDOMAINS=xxxxxnas,subdomain2

    - TOKEN=xxxxxxxxxxxxxx-xxxxxx

    restart: unless-stopped

    mariadb:

    image: linuxserver/mariadb

    container_name: nextclouddb

    environment:

    - PUID=1000

    - PGID=100

    - MYSQL_ROOT_PASSWORD=xxxxxxxx

    - TZ=Europe/Berlin

    volumes:

    - /srv/dev-disk-by-label-Daten1/dockerconfig/mariadb:/config

    restart: unless-stopped

    letsencrypt:

    image: linuxserver/letsencrypt

    container_name: letsencrypt

    cap_add:

    - NET_ADMIN

    environment:

    - PUID=1000

    - PGID=100

    - TZ=Europe/Berlin

    - URL=xxxxxnas.duckdns.org

    - SUBDOMAINS=www,

    - VALIDATION=duckdns

    - DUCKDNSTOKEN=xxxx-xxxxxx

    - EMAIL=me@xxmail.com

    volumes:

    - /srv/dev-disk-by-label-Daten1/dockerconfig/letsencrypt:/config

    ports:

    - 444:443

    - 81:80

    restart: unless-stopped



    i also used the duckdns image.. after exploying

    can now access nextcloud an set it up.


    I use subdomain method..


    when i got to subfolder-method i get "insert trusted domain errors" how can i set it up with subfolder ?


    Morlan

    MSI B-250-DS3H-G4560 | some RAM | someTB WD red (snapraid) | OMV 5.x (latest) | DD Cine S2 V6.5

    Edited once, last by Ruschi ().

  • Did you add this to your config.php?

    yes i did.. what wrong here :


    <?php

    $CONFIG = array (

    'memcache.local' => '\\OC\\Memcache\\APCu',

    'datadirectory' => '/data',

    'trusted_proxies' => ['letsencrypt'],

    'instanceid' => 'xxxxxxxxxxxx',

    'passwordsalt' => 'monaWKzrT3hSSAjxxxxxxxxxxx',

    'secret' => 'o0d1zWxxxxxxxxxxxxCDeCgxxxxxxxxx8DpsE9K89T/FajUiOm',

    'trusted_domains' =>

    array (

    0 => 'xxxxnas.duckdns.org/nextcloud',

    ),

    'dbtype' => 'mysql',

    'version' => '20.0.1.1',

    'overwritewebroot' => '/nextcloud',

    'dbname' => 'nextcloud',

    'dbhost' => 'mariadb',

    'dbport' => '',

    'dbtableprefix' => 'oc_',

    'mysql.utf8mb4' => true,

    'dbuser' => 'oc_xxxx',

    'dbpassword' => '8AOfdxxxxxxxxxxxxxMczk20BxxxxxJD',

    'installed' => true,

    );


    iḿ a noob :-)


    Morlan

    MSI B-250-DS3H-G4560 | some RAM | someTB WD red (snapraid) | OMV 5.x (latest) | DD Cine S2 V6.5

  • I assumed Ruschi was using the subdomain route because it was mentioned a couple of times:

    Quote from Ruschi

    1st of all some informations:

    OMV5, DuckDNS, domain: https://xxxxnas.duckdns.org (is a subdomain ??)

    and

    this is still the sample. I didnt change it to nextcloud.subdomain.conf... in the guide he changes this:

    I must have read too much into those comments. My mistake.

    Simple and sure backup and restore: In a Scheduled Job: rsync -av --delete /srv/dev-disk-by-label-SOURCE/ /srv/dev-disk-by-label-DESTINATION/ (HT: Getting Started with OMV5)
    OMV Version: Ver. 5 (current) - Hardware: NanoPi M4, Nextcloud, Plex, Airsonic, Booksonic, Calibre, & Heimdall - Acer Aspire T180, backup - Odroid XU4, Pi-Hole (DietPi) - Testing/Playing: hc2, xu4, Pi 3B+, Odroid H2, and HP dx2400, Debian 10 XFCE.

  • Hello guys I can't access to nextcloud:(

    This is the stack :

    I am using nextcloud.subfolder.conf

    And this is the /config/www/nextcloud/config/config.php :

    I'd appreciate your help

    Iam using OMV5 and my board is Odroid HC1

  • If that is a real DuckDNS token in your compose file you need to obfuscate it in the post. If so you might also generate a new token at the DuckDNS site.


    I don’t use the subfolder route, so I’m not real familiar with the nextcloud.subfolder.conf file. I think Morlan is the go-to guy for a subfolder setup.


    A lot of times you are just missing a line (or one period-slash-quote) that is preventing success. Go back and compare your php and conf files with the examples in this thread and look closely at punctuation marks.


    Your compose file looks okay. What kind of errors do you get? Can you reach a web page that says something like “welcome”?

    Simple and sure backup and restore: In a Scheduled Job: rsync -av --delete /srv/dev-disk-by-label-SOURCE/ /srv/dev-disk-by-label-DESTINATION/ (HT: Getting Started with OMV5)
    OMV Version: Ver. 5 (current) - Hardware: NanoPi M4, Nextcloud, Plex, Airsonic, Booksonic, Calibre, & Heimdall - Acer Aspire T180, backup - Odroid XU4, Pi-Hole (DietPi) - Testing/Playing: hc2, xu4, Pi 3B+, Odroid H2, and HP dx2400, Debian 10 XFCE.

    Edited once, last by Agricola ().

  • Token recreate

    The error : welcome to our server

Participate now!

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