UGREEN NAS Docker Install - SQL Error during Admin creation on 1st log-in

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 32.0.5.0
  • Operating system and version (e.g., Ubuntu 24.04):
    • UGOS 1.12.1
  • Web server and version (e.g, Apache 2.4.25):
    • replace me
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • replace me
  • PHP version (e.g, 8.3):
    • replace me
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • First installation
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Docker
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

After having successfully installed and deployed the Nextcloudcontainer via Docker on a UGREEN NAS DXP4800Pro, when trying to create the admin account during the first log-in, I get the following error:

“Error while trying to create admin account: An exception occurred in the driver: SQLSTATE[HY000] [1130] Host ‘172.24.0.4’ is not allowed to connect to this MariaDB server”

Steps to replicate it (hint: details matter!):

Log entries

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

nextcloud_db     | 2026-01-19 12:15:11 7 [Warning] Aborted connection 7 to db: 'unconnected' user: 'unauthenticated' host: '172.24.0.4' (This connection closed normally without authentication)
nextcloud_db     | 2026-01-19 12:52:26 8 [Warning] Aborted connection 8 to db: 'unconnected' user: 'unauthenticated' host: '172.24.0.4' (This connection closed normally without authentication)

Web Browser

If the problem is related to the Web interface, open your browser inspector Console and Network tabs while refreshing (reloading) and reproducing the problem. Provide any relevant output/errors here that appear.

PASTE

Web server / Reverse Proxy

The output of your Apache/nginx/system log in /var/log/____:

PASTE HERE

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

<?php
$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'upgrade.disable-web' => true,
  'instanceid' => 'EDITED',
  'passwordsalt' => 'EDITED',
  'secret' => 'EDITED',
  'trusted_domains' => 
  array (
    0 => '192.168.178.xx:8080',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '32.0.5.0',
  'overwrite.cli.url' => 'http://192.168.178.xx:8080',
  'dbname' => 'nextcloud',
  'dbhost' => 'db',
  'dbtableprefix' => 'oc_',
);

Apps

The output of occ app:list (if possible).

Tips for increasing the likelihood of a response

  • Use the preformatted text formatting option in the editor for all log entries and configuration output.
  • If screenshots are useful, feel free to include them.
    • If possible, also include key error output in text form so it can be searched for.
  • Try to edit log output only minimally (if at all) so that it can be ran through analyzers / formatters by those trying to help you.

Please post your Compose file and detail the specific deployment steps you took.

Are you sure you aren’t reusing db container (or volume) from a prior test run or something?

Hello,

it is a clean installation on a new NAS.

I have created the folder /volume1/Docker/nextcloud and then these subfolders prior to installation:

  • db
  • data
  • config
  • redis

Afterwards I installed it via Docker using the docker-compose.yaml file below.

After completing the installation I had an issue with the nextcloud_db container that was keeping restarting due to what it seemed to be an access right issue.

I executed following commands via PuTTY

cd /volume1/Docker
sudo chown -R www-data:www-data nextcloud
sudo docker compose down
sudo docker compose up -d

and afterwards the nextcloud_db issue was solved and I got no errors and everything seems to be running well.

But when I try to log in via the web interface, I get the error as described in my first post.

docker-compose.yaml

version: '3.8'


services:
  db:
    image: mariadb:10.6
    container_name: nextcloud_db
    restart: unless-stopped
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    volumes:
      - /volume1/Docker/nextcloud/db:/var/lib/mysql # Adjust this path to your NAS volume
    environment:
      MYSQL_ROOT_PASSWORD: <mypassword> # Change this to a strong password
      MYSQL_DATABASE: nextcloud
      MYSQL_USER: nextcloud
      MYSQL_PASSWORD: <mypasswordSQL> # Change this to a strong password


  app:
    image: nextcloud:latest
    container_name: nextcloud_app
    restart: unless-stopped
    volumes:
      - /volume1/Docker/nextcloud/data:/var/www/html/data # Adjust this path to your NAS volume
      - /volume1/Docker/nextcloud/config:/var/www/html/config # Adjust this path to your NAS volume
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    environment:
      PUID: 1000 # Your User ID
      PGID: 100 # Your Group ID
      NEXTCLOUD_TRUSTED_DOMAINS: <mylocalNASip> # (192.168.178.xx) e.g., 192.168.1.100 or your.domain.com
      MYSQL_DATABASE: nextcloud
      MYSQL_USER: nextcloud
      MYSQL_PASSWORD: <mypasswordSQL> # Use the same password as above
      MYSQL_HOST: db # This matches the service name of the database container
      TZ: Europe/Berlin # Adjust to your timezone
    ports:
      - 8080:80 # Corrected: Needs host_port:container_port
    depends_on:
      - db


  # Optional: Redis for Nextcloud performance
  redis:
    image: redis:latest
    container_name: nextcloud_redis
    restart: unless-stopped
    command: redis-server --appendonly yes --requirepass <mypasswordredis> # Corrected: Entire command string quoted
    volumes:
      - /volume1/Docker/nextcloud/redis:/data # Adjust this path to your NAS volume

Couple things:

  • Your persistent volume configuration for the Nextcloud container is incomplete/incorrect – it lacks coverage of the installation folder itself (see https://github.com/nextcloud/docker?tab=readme-ov-file#persistent-data)
  • You have some environment variables listed for the nextcloud image which appear to be for a different image (some of them look like they’re for the LSIO Nextcloud image). Specifically PUID/PGID/TZ
  • Personally I’d suggest clearing out the db volume and removing (not simply downing or restarting) that container since it’s unclear what state it was in or partially started then restarted, etc. from the earlier problem.

If still stuck, take advantage of it being containers and easy to test stuff: