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

  • I actually also don’t use sub folder method. I can’t spot an obvious error. What is the output of the letsencrypt container log?

    nextcloud.subfolder.conf and nextcloud.subdomain.conf same error

    letsencrypt log :

    Code
    [cont-init.d] 90-config: exited 0.
    [cont-init.d] 99-custom-files: executing...
    [custom-init] no custom files found exiting...
    [cont-init.d] 99-custom-files: exited 0.
    [cont-init.d] done.
    [services.d] starting services
    [services.d] done.
    nginx: [alert] detected a LuaJIT version which is not OpenResty's; many optimizations will be disabled and performance will be compromised (see https://github.com/openresty/luajit2 for OpenResty's LuaJIT or, even better, consider using the OpenResty releases from https://openresty.org/en/download.html)
    Server Ready

    nextcloud.subdomain.conf:

    config.php:

    and when I type: https://nextcloud.xxxx.duckdns.org I get : Welcome to our server

  • In your compose file try this instead in the bottom section:

    - URL=duckdns.org

    - SUBDOMAINS=xxxx

    - VALIDATION=http

    The subdomains you have listed on line 46 needs to be the same subdomains you have listed earlier on line 23. The ones you got from DuckDNS. And then in your .php file instead of nextcloud.xxxx just use your xxx subdomain.

    Like this:

    Code
    'overwrite.cli.url' => 'https://xxxx.duckdns.org',
    'overwritehost' => 'xxxx.duckdns.org',
    'overwriteprotocol' => 'https',
    'trusted_domains' =>
    array (
    0 => 'xxxx.duckdns.org',
    ),

    proxy_max_temp_file_size 1024m;

    in your nextcloud.subdomain.conf file change your file size to 2048. And instead of nextcloud.* just use your subdomain you got from duckdns: xxx.*


    What I did to set up my Nextcloud may not be the way most have set up theirs, but my Nextcloud address is simply https://xxx.duckdns.org

    I hope this helps and is not too confusing.

    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 5 (current) - Hardware: Thinkserver TS140, Nextcloud, Plex, Airsonic, Navidrome, Ubooquity, Digikam, & Heimdall - NanoPi M4 (v.1), backup - Odroid XU4, Pi-Hole (DietPi) - Testing/Playing: hc2, xu4, Pi 3B+, Odroid H2. Mac user trying to convert to Linux on a HP dx2400, Debian 10 XFCE.

  • I followed the instructions to the letter and I get: welcome to our server:(:(

  • All of my cut/paste was a bit confusing. Let me post my example files:

    on the config.php file you only need to concentrate on the small part in the middle:

    Once logged into Nextcloud, the setup fills in the rest of config.php below this, such as mail info. Also note that the letsencrypt docker has been deprecated. It still works (for now) but swag is the new letsencrypt.


    Hope this helps.


    Edit: Sorry, I lost all of my indents when I entered the code.

    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 5 (current) - Hardware: Thinkserver TS140, Nextcloud, Plex, Airsonic, Navidrome, Ubooquity, Digikam, & Heimdall - NanoPi M4 (v.1), backup - Odroid XU4, Pi-Hole (DietPi) - Testing/Playing: hc2, xu4, Pi 3B+, Odroid H2. Mac user trying to convert to Linux on a HP dx2400, Debian 10 XFCE.

  • Thank you very much for your help

    I will try tomorrow;)

  • I'm relatively new to OMV, & Nextcloud. I've successfully installed nextcloud, swag and mariadb via the guide in this thread. I'm running Nextcloud on a subdomain. My external DNS is cloudflare. My nextcloud site is secure running on my external subdomain. I authenticated my domain via cloudflare dns and set the domains to wildcard.


    I keep trying to install onlyoffice via the supplemental instructions, but continue to receive a connection refused.


    I've read the posts in this thread but continue to have issues. I think I'm getting my reverse proxy wrong. I don't know.


    I'm not certain how to proceed with troubleshooting.


    I do see that I'm receiving these database error sin the documentserver instance:


    "* Starting PostgreSQL 10 database server,
    * Error: /usr/lib/postgresql/10/bin/pg_ctl /usr/lib/postgresql/10/bin/pg_ctl start -D /var/lib/postgresql/10/main -l /var/log/postgresql/postgresql-10-main.log -s -o -c config_file="/etc/postgresql/10/main/postgresql.conf" exited with status 1: ,
    2020-11-12 01:18:44.727 UTC [234] LOG: could not translate host name "localhost", service "5432" to address: Temporary failure in name resolution,
    2020-11-12 01:18:44.727 UTC [234] WARNING: could not create listen socket for "localhost",
    2020-11-12 01:18:44.727 UTC [234] FATAL: could not create any TCP/IP sockets,
    2020-11-12 01:18:44.727 UTC [234] LOG: database system is shut down,
    pg_ctl: could not start server,
    Examine the log output.,
    ...fail!,
    * Starting RabbitMQ Messaging Server rabbitmq-server,
    ...done.,
    Waiting for connection to the localhost host on port 5432,"



    My stack is as follows:


    "

    version: "2"

    services:

    nextcloud:

    image: linuxserver/nextcloud

    container_name: nextcloud

    environment:

    - PUID=1000 #change PUID if needed

    - PGID=100 #change PGID if needed

    - TZ=America/Chicago #change Time Zone if needed

    volumes:

    - /<mypath>/appdata/nextcloud/config:/config #/srv/dev-disk-by-label-disk1 needs to be adjusted

    - /<mypath>/appdata/nextcloud/data:/data #/srv/dev-disk-by-label-disk1 needs to be adjusted

    depends_on:

    - mariadb

    # ports: # uncomment this and the next line if you want to bypass the proxy

    # - 450:443

    restart: unless-stopped

    mariadb:

    image: linuxserver/mariadb

    container_name: nextclouddb

    environment:

    - PUID=1000 #change PUID if needed

    - PGID=100 #change PGID if needed

    - MYSQL_ROOT_PASSWORD= <I set this> #change password

    - TZ=America/Chicago #Change Time Zone if needed

    volumes:

    - /<mypath>/appdata/nextclouddb:/config

    # - /<mypath>/appdata/mariadb:/config# /srv/dev-disk-by-label-disk1 needs to be adjusted

    restart: unless-stopped

    swag:

    image: linuxserver/swag #swag is the replacement for letsencrypt (see link below)

    container_name: swag

    cap_add:

    - NET_ADMIN

    environment:

    - PUID=1000 #change PUID if needed

    - PGID=100 #change PGID if needed

    - TZ=America/Chicago # change Time Zone if needed

    - URL=<I set this> #insert your domain name - yourdomain.url

    - SUBDOMAINS=wildcard

    - VALIDATION=dns

    - DNSPLUGIN=cloudflare #optional

    - EMAIL=bruce@acstrat.com # define email; required to renew certificate

    - MAXMINDDB_LICENSE_KEY=<I set this>

    volumes:

    - /<mypath>/appdata/swag:/config #/srv/dev-disk-by-label-disk1 needs to be adjusted

    ports:

    - 444:443

    - 81:80

    restart: unless-stopped

    onlyofficedocker:

    image: onlyoffice/documentserver:latest

    container_name: onlyofficedocker

    stdin_open: true

    restart: always

    environment:

    - JWT_ENABLED=true

    - JWT_SECRET=<I set this> #you will need this in nextcloud after

    ports:

    - 4433:443

    volumes:

    - /<mypath>/appdata/onlyoffice/DocumentServer/data/:/var/www/onlyoffice/Data

    - /<mypath>/appdata/onlyoffice/DocumentServer/logs:/var/log/onlyoffice

    - /<mypath>/appdata/onlyoffice/DocumentServer/lib:/var/lib/onlyoffice

    - /<mypath>/appdata/onlyoffice/DocumentServer/db:/var/lib/postgresql

    - /<mhypath>/appdata/onlyoffice/DocumentServer/fonts:/usr/share/fonts/truetype/custom

    -/<mypath>/appdata/onlyoffice/DocumentServer/forgotten:/var/lib/onlyoffice/documentserver/App_Data/cache/files/forgotten

    - /<mypath>/appdata/onlyoffice/DocumentServer/data/:/var/www/onlyoffice/Data onlyoffice/documentserver

  • I've updated NC to version 20.0.2

    Now I get the message that some primary keys are missing and NC suggests to execute the command "occ db:add-missing-primary-keys".

    But I have no clue where or how to execute this.

    I tried

    Code
    /srv/dev-disk-by-label-Docker/appdata/nextcloud/config/www/nextcloud# sudo -u www-data php occ db:add-missing-primary-keys

    but get the following message:

    Quote

    Cannot write into "config" directory! This can usually be fixed by giving the webserver write access to the config directory

    Any ideas how to fix this?

  • Try


    docker exec -it nextcloud sudo -u abc php /config/www/nextcloud/occ db:add-missing-primary-keys


    Alternatively open the console of your nextcloud container within Portainer. Change directory towards /config/www/nextcloud and perform


    sudo -u abc php occ db:add-missing-primary-keys

    Chaos is found in greatest abundance wherever order is being sought.
    It always defeats order, because it is better organized.
    Terry Pratchett

  • In Nextcloud the plugin page states that the occ plugin (which is an internal command line plugin just for Nextcloud) is incompatible with any version above 18 but I downloaded it anyway and it works. Just download, install and select occ in the top menu. At the occ prompt type db:add-missing-primary-keys and press return. the missing database keys were added, and the errors went away from the Administration/Overview page. Everything may go up in a cloud of smoke tomorrow but it worked for me a couple of days ago.

    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 5 (current) - Hardware: Thinkserver TS140, Nextcloud, Plex, Airsonic, Navidrome, Ubooquity, Digikam, & Heimdall - NanoPi M4 (v.1), backup - Odroid XU4, Pi-Hole (DietPi) - Testing/Playing: hc2, xu4, Pi 3B+, Odroid H2. Mac user trying to convert to Linux on a HP dx2400, Debian 10 XFCE.

  • Well, there’s not a straightforward answer because it depends on how Nextcloud was installed. If you used this [How-To] by macom then I think it automatically renews.

    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 5 (current) - Hardware: Thinkserver TS140, Nextcloud, Plex, Airsonic, Navidrome, Ubooquity, Digikam, & Heimdall - NanoPi M4 (v.1), backup - Odroid XU4, Pi-Hole (DietPi) - Testing/Playing: hc2, xu4, Pi 3B+, Odroid H2. Mac user trying to convert to Linux on a HP dx2400, Debian 10 XFCE.

  • Well it seems this does not work with nextcloud 19.0.4 .

    Told me that Gallery is not compatible to it.

    I was wrong here. It works!

    You just have to ignore this message and manually activate the app in the app manager. You have to activate it 2 times. First time you confirm to be working with an incompatible app, second time you really activate it.

    I then deactivated the new "photos" app.

    Works fine. A lot better than "photos".

  • Hi! Thank you for this fantastic guide, I finally got it working, and hooked it up with my personal domain (ex. drive.mydomain.net).


    But here is the problem, I host this domain on namecheap.com's cpanel. the A record for "mydomain.net" is pointed to their ip. In order for the nextcloud to work, I had to change "mydomain.net"'s A record to my ip. This cause my website to disconnect.


    Is there a way for me to keep both my website and nextcloud?


    Thank you!

Participate now!

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