Nextcloud Docker with MariaDB - unable to access webui

Hi,

I’ve created a nextcloud stack within Portainer and I’m having issues accessing the webui. It seems to be a common issue but unable to troubleshoot from previous forum correspondence.

The following is my docker-compose:

version: '2'

services:
  db:
    image: mariadb:10.6
    restart: always
    command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
    volumes:
      - /home/user/nextcloud/db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=password
      - MYSQL_PASSWORD=password
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud

  app:
    image: nextcloud
    restart: always
    ports:
      - 443:443
    links:
      - db
    volumes:
      - /mnt/files/nextcloud:/var/www/html/data
      - /home/user/nextcloud/config:/var/www/html/config
      - /home/user/nextcloud/custom_apps:/var/www/html/custom_apps
      - /home/user/nextcloud/themes:/var/www/html/themes
    environment:
      - MYSQL_PASSWORD=password
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_HOST=db

My nextcloud-app-1 logs are as follows:

Initializing nextcloud 26.0.2.1 ...

New nextcloud instance

Initializing finished

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 192.168.32.3. Set the 'ServerName' directive globally to suppress this message

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 192.168.32.3. Set the 'ServerName' directive globally to suppress this message

[Wed Jun 07 00:41:20.739036 2023] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.56 (Debian) PHP/8.2.6 configured -- resuming normal operations

[Wed Jun 07 00:41:20.739067 2023] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'

Thank you~

hi @broomwalker welcome to the forum :handshake:

there are some issues with your compose file.

  • links directive is deprecated you should consider using default network (every -compose file get a default network ā€œfor freeā€ no need to configure anything) - but I’m unsure you need compose format 3.x or at least 2.2
  • exposing 443:443 on Nextcloud container is pontless
    • as it doesn’t ship a TLS cert so you can’t connect to the container using TLS
    • and the container doesn’t listen on :443 (only :80) - use reverse proxy like traefik, nginx or other to setup ā€œTLS terminationā€

I would recommend starting with official examples which use redis for file locking and shows much better technique of environment variables configuration using db.env file or use AiO for best results.

I don’t know Portainer maybe you are limited there but I would recommend against using plain ā€˜nextcloud’ image (which corresponds to ā€˜:latest’) - better define specific version tag e.g. ā€˜nextcloud:26.0.2’ so you remain in control of the upgrade process (at least for major versions).

What’s Wrong With The Docker :latest Tag?

1 Like

Thanks - it looked like if I changed the port it would boot up the Web UI but I came across another error.

I’ve scrapped that docker-compose and the idea of storing Nextcloud data on a NFS share for now, and would just try and get it installed and have a play around.

I’ve loaded the below docker-compose up but I’m not getting a ā€œcreate an admin accountā€ prompt when it was spun up. It’s expecting me to already have an account to login to…

version: '2'

volumes:
  nextcloud:
  db:

services:
  db:
    image: mariadb
    restart: always
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW --innodb-file-per-table=1 --skip-innodb-read-only-compressed

    volumes:
      - db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=password
      - MYSQL_PASSWORD=password
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud

  app:
    image: nextcloud
    restart: always
    ports:
      - 6888:80
    links:
      - db
    volumes:
      - nextcloud:/var/www/html
    environment:
      - MYSQL_PASSWORD=password
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_HOST=db

There are only two ways I can think of that happening (assuming you’re not somehow connecting to your old test stack):

  • your db container persistent volume was setup once previously
  • your app container persistent volume was setup once previously

Any chance you started that new test stack once previously?

In any case, without logs it’s impossible to say.

If you’re just testing, you can just delete both your named volumes in that stack then start it all up again.

1 Like