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

  • Then maybe I'd better postpone the migration of the mariadb docker provider, but at the latest by the time nextcloud 21 is available for my HW platform.

    OMV 7.0.5 Sandworm | omvextrasorg 7.0 | compose 7.1 | Linux 6.6.16-current-mvebu | Armbian 24.2.1 Bookworm | Hardware Helios4 | RAID5 with 4 * 8TB WD Red

    • Offizieller Beitrag

    I don't think so, since the duckdns key and subdomain information is listed in the swag portion of the docker-compose file. I haven't tried it myself without it though.

  • Just make sure you have a working backup. It tried to migrate a test instance this morning and wasn’t able to get Nextcloud to connect to the migrated database.


    Then maybe I'd better postpone the migration of the mariadb docker provider, but at the latest by the time nextcloud 21 is available for my HW platform.


    With a little more time I was able to successfully migrate the database now. It was a problem of database permissions.

    I try to write a small guide tomorrow.

  • Hello, i have trouble with my docker GUIDE installation.


    - i don't get updates for my duckdns service.

    - fetch problem RE: apt update - W: Failed to fetch http:/.......................... - solved by @dleiderthttps://forum.openmediavault.org/index.php?thread/37562-apt-update-w-failed-to-fetch-http/&postID=265866#post265866


    Why we use "dev-disk-by-label-disk" and not the "uuid"?


    @all

    When did have check, install the GUIDE [How-To] Nextcloud with Letsencrypt using OMV and docker-compose?

    The GUIDE is very old.

    Which OMV 5 Debian 10 Base installation should i'm prefer?

    • Offizieller Beitrag

    Which OMV 5 Debian 10 Base installation should i'm prefer

    You are getting yourself confused this thread and this Q&A have nothing to do with each other, this guide will simply install Nextcloud with Letsencrypt on OMV using docker compose.

    • Offizieller Beitrag

    I won't to have a OMV 5 Installation with Docker_Nextcloud_SWAG.

    I know what you want, the HOWTO which this Q&A relates to will do that, I haven't read all this thread but SWAG replaces Letsencrypt I believe.


    The change from dev-disk-by-label to to dev-disk-by-uuid was brought about by the changes in OMV, so all one does is substitute/change those references.

  • I try to write a small guide tomorrow.

    We would be grateful ;)

    Thank you for all the work done in this "how-to" ;)

    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
  • FredK Here's the guide. I hope I didn't forget a step...


    I assume you are doing this with root privileges

    • Get database password from nextcloud config.php: cat /srv/dev-disk-by-label-disk1/appdata/nextcloud/config/www/nextcloud/config/config.php
    • Save the password under 'dbpassword' somewhere
    • Enable maintenance mode of nextcloud docker: docker exec nextcloud sudo -u abc php /config/www/nextcloud/occ maintenance:mode --on
    • Create database backup: docker exec -it nextclouddb bash
    • mysqldump --single-transaction -u root -p nextcloud > /config/nc_backup.bkp
    • Enter mariadb_root_password
    • exit
    • Stop containers: cd /home/docker1/nextcloud && docker-compose down
    • Open docker-compose.yml: nano docker-compose.yml
    • Comment out old mariadb-container:


    Below insert new MariaDB-block:

    Code
       mariadb:
          image: webhippie/mariadb:latest
          container_name: nextclouddb
          environment:
             - MARIADB_ROOT_PASSWORD=mariadbpassword   
          volumes:
             - /srv/dev-disk-by-label-disk1/appdata/nextclouddb_new/mysql:/var/lib/mysql #/srv/dev-disk-by-label-disk1 needs to be adjusted
             - /srv/dev-disk-by-label-disk1/appdata/nextclouddb_new/conf.d:/etc/mysql/conf.d #/srv/dev-disk-by-label-disk1 needs to be adjusted
             - /srv/dev-disk-by-label-disk1/appdata/nextclouddb_new/backup:/var/lib/backup #/srv/dev-disk-by-label-disk1 needs to be adjusted
          restart: unless-stopped
    • Start containers: docker-compose up -d
    • Copy backup to new container: cp /srv/dev-disk-by-label-disk1/appdata/nextclouddb/nc_backup.bkp /srv/dev-disk-by-label-disk1/appdata/nextclouddb_new/mysql/
    • Import database: docker exec -it nextclouddb bash
    • mysql -u root -p
    • Enter new_mariadb_root_password
    • CREATE DATABASE nextcloud;
    • GRANT USAGE ON *.* TO 'oc_admin'@'%' IDENTIFIED BY 'enter_dbpassword_from_config.php';
    • GRANT ALL PRIVILEGES ON nextcloud.* TO 'oc_admin'@'%' ;
    • FLUSH PRIVILEGES;
    • EXIT
    • mysql -u root -p nextcloud < /var/lib/mysql/nc_backup.bkp
    • Enter new_mariadb_root_password
    • exit
    • Restart nextcloud docker: docker restart nextcloud
    • Disable maintenance mode of nextcloud docker: docker exec nextcloud sudo -u abc php /config/www/nextcloud/occ maintenance:mode --off
    • Cross your fingers...
  • Thank you Morlan. Tomorrow I'll give it a try. Fingers already crossed.

    OMV 7.0.5 Sandworm | omvextrasorg 7.0 | compose 7.1 | Linux 6.6.16-current-mvebu | Armbian 24.2.1 Bookworm | Hardware Helios4 | RAID5 with 4 * 8TB WD Red

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


    Zitat

    Then maybe I'd better postpone the migration of the mariadb docker provider, but at the latest by the time nextcloud 21 is available for my HW platform.


    Zitat

    Quote from Morlan



    I try to write a small guide tomorrow.



    Hello Morian, did you mean this guide #533 ?


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

  • Morlan
    I'm stuck at last step (Disable maintenance mode)

    See my comments inline.

    EDIT:

    After repeating the database command using oc_he instead of oc_admin disabling maintenance mode was successful.

    Nextcloud started, login successful!

    OMV 7.0.5 Sandworm | omvextrasorg 7.0 | compose 7.1 | Linux 6.6.16-current-mvebu | Armbian 24.2.1 Bookworm | Hardware Helios4 | RAID5 with 4 * 8TB WD Red

    Einmal editiert, zuletzt von FredK () aus folgendem Grund: I got it!

  • Zitat

    Could it be that I created nextcloud in the past as my unprivileged user "he"?

    maybe it’s the user you specified as admin when setting up Nextcloud. Mine was called admin in the Test instance.

    I’m glad it worked!

  • FredK Here's the guide. I hope I didn't forget a step...


    I assume you are doing this with root privileges

    • Get database password from nextcloud config.php: cat /srv/dev-disk-by-label-disk1/appdata/nextcloud/config/www/nextcloud/config/config.php
    • Save the password under 'dbpassword' somewhere
    • Enable maintenance mode of nextcloud docker: docker exec nextcloud sudo -u abc php /config/www/nextcloud/occ maintenance:mode --on
    • Create database backup: docker exec -it nextclouddb bash
    • mysqldump --single-transaction -u root -p nextcloud > /config/nc_backup.bkp
    • Enter mariadb_root_password
    • exit
    • Stop containers: cd /home/docker1/nextcloud && docker-compose down
    • Open docker-compose.yml: nano docker-compose.yml
    • Comment out old mariadb-container:


    Below insert new MariaDB-block:

    Code
       mariadb:
          image: webhippie/mariadb:latest
          container_name: nextclouddb
          environment:
             - MARIADB_ROOT_PASSWORD=mariadbpassword   
          volumes:
             - /srv/dev-disk-by-label-disk1/appdata/nextclouddb_new/mysql:/var/lib/mysql #/srv/dev-disk-by-label-disk1 needs to be adjusted
             - /srv/dev-disk-by-label-disk1/appdata/nextclouddb_new/conf.d:/etc/mysql/conf.d #/srv/dev-disk-by-label-disk1 needs to be adjusted
             - /srv/dev-disk-by-label-disk1/appdata/nextclouddb_new/backup:/var/lib/backup #/srv/dev-disk-by-label-disk1 needs to be adjusted
          restart: unless-stopped
    • Start containers: docker-compose up -d
    • Copy backup to new container: cp /srv/dev-disk-by-label-disk1/appdata/nextclouddb/nc_backup.bkp /srv/dev-disk-by-label-disk1/appdata/nextclouddb_new/mysql/
    • Import database: docker exec -it nextclouddb bash
    • mysql -u root -p
    • Enter new_mariadb_root_password
    • CREATE DATABASE nextcloud;
    • GRANT USAGE ON *.* TO 'oc_admin'@'%' IDENTIFIED BY 'enter_dbpassword_from_config.php';
    • GRANT ALL PRIVILEGES ON nextcloud.* TO oc_admin@%;
    • FLUSH PRIVILEGES;
    • EXIT
    • mysql -u root -p nextcloud < /var/lib/mysql/nc_backup.bkp
    • Enter new_mariadb_root_password
    • exit
    • Restart nextcloud docker: docker restart nextcloud
    • Disable maintenance mode of nextcloud docker: docker exec nextcloud sudo -u abc php /config/www/nextcloud/occ maintenance:mode --off
    • Cross your fingers...

    Been a long time reader with no input, soz.


    1st, Thank you ALL for every input on this thread.

    I managed to have all running on a RPi4, flawless.


    Just a small remark about this:

    I already enabled the 4 Byte UTF support on the DB, as mentioned here: Enabling MySQL 4-byte support — Nextcloud latest Administration Manual latest documentation


    With this, shouldn't the commands for backup and restore be sligthly different?!?


    BACKUP:

    Zitat


    Note

    Also make sure your backup strategy still work. If you use mysqldump make sure to add the --default-character-set=utf8mb4 option. Otherwise your backups are broken and restoring them will result in ? instead of the emojis, making files inaccessible.

    [/BACKUP]


    [RESTORE]

    Zitat

    If you use UTF8 with multibyte support (e.g. for emojis in filenames), use:

    Code
    mysql -h [server] -u [username] -p[password] -e "DROP DATABASE nextcloud"
    mysql -h [server] -u [username] -p[password] -e "CREATE DATABASE nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci"

    [/RESTORE]


    Sorry for asking but I'm not a very knowlegble person on Linux/SQL/etc.


    And, since I had to re-do all installation, several times till I got it right, I don't want to mess things up, :)


    Thank you all

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!