Nextcloud and MariaDB

Good question and yes, this is mostly by design, not a mistake on your part.

Short answer: containers separate apps, not storage.

What’s happening is:

  • Nextcloud (the app) runs inside a container
  • Your storage pool is mounted into the container as a volume
  • So from the OS point of view they’re separate, but from inside Nextcloud it looks like “part of the system”

This is normal Docker behavior and not a ZimaOS limitation.

What you can do (and what most people do):

  • Keep Nextcloud app data (config, database, cache) in
    /DATA/AppData/nextcloud
  • Point Nextcloud user data to a dedicated subfolder in your pool, e.g.
    /DATA/NextcloudData

That keeps things clean and makes backups, restores, or even replacing Nextcloud much easier.

So:

  • Containers stay isolated
  • Your storage pool stays shared
  • Data ownership and structure are still fully under your control

ZimaOS is handling this the right way, it gives you separation where it matters (apps), without locking your data away.

Hi,

I seem to have a problem again. I’ve shutdown my ZimaOS using ZimaOS itself so I could add 2 more HDD’s. After starting up, Nextcloud refuses to startup.

I followed your steps again using ssh and the folowing error occurred:

root@ZimaOS:/root ➜ # docker exec -it nextcloud ping -c 3 mariadb
OCI runtime exec failed: exec failed: unable to start container process: exec: “ping”: executable file not found in $PATH: unknown

I should be able to restart my home server without these problems popping up I assume…Have I misses something?

You didn’t miss anything, this part is actually expected behavior, and it’s not the cause of Nextcloud failing to start.

About the ping error

exec: "ping": executable file not found

I believe this simply means the Nextcloud container image doesn’t include ping. Many minimal containers remove it on purpose. This does not indicate a network failure and does not mean MariaDB is unreachable.

So this command failing is normal and can be ignored.

What likely happened after the reboot
I believe one of these occurred when the system restarted after adding disks:

  • MariaDB started after Nextcloud, so Nextcloud failed its initial DB check
  • The MariaDB container IP changed, and Nextcloud is still pointing to the old one
  • Nextcloud tried to start before the storage pool was fully mounted

These are timing/order issues, not configuration errors.

What I suggest checking

  1. Confirm MariaDB is running first:
docker ps
  1. Get the current MariaDB IP (it may have changed):
docker inspect mariadb --format '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}'
  1. Make sure Nextcloud is using that current IP in its DB host:
<current-ip>:3306
  1. Restart MariaDB first, then Nextcloud.

Important, reassurance
You should be able to reboot your server safely, and you can. The key thing to know is that when using container IPs, they can change after a restart. That’s why this showed up again.

This isn’t something you broke, and it doesn’t mean your setup is unstable. It’s a side effect of using IP-based DB connections as a workaround.

Once you confirm the current MariaDB IP and restart Nextcloud, it should come straight back up.

Thank you for your help. So it is because I am working with a fixed IP and not with localhost. tbh this is a bit bothersome but I’ll try to make it work.

The IP address indeed changed, So I changed it in my config.php to the new IP address.

I assume there is no way to make this work as “localhost:3306” on ZimOS?