Nextcloud datadir changes after reboot (or can't be found)

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):
    • Nextcloud AIO v12.8.0

Summary of the issue you are facing:

After a reboot my datadir isn’t found? I installed Nextcloud AIO on a raid 1 mounted drive and included that in the docker command:

sudo docker run \
  --init \
  --sig-proxy=false \
  --name nextcloud-aio-mastercontainer \
  --restart always \
  --publish 80:80 \
  --publish 8080:8080 \
  --publish 8443:8443 \
  --env NEXTCLOUD_DATADIR="/media/daan/a15e1c0a-dc19-4b76-8d00-f248a4739987/nextclouddata/ncdata/" \
  --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
  --volume /var/run/docker.sock:/var/run/docker.sock:ro \
  ghcr.io/nextcloud-releases/all-in-one:latest

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

On Restart I keep getting this error:

2026-03-26T19:12:54.518361095Z  2026-03-26 19:12:54.517872+00
2026-03-26T19:12:54.518363482Z (1 row)
2026-03-26T19:12:54.518366027Z 
2026-03-26T19:12:54.527088209Z + '[' -f /dev-dri-group-was-added ']'
2026-03-26T19:12:54.527375397Z ++ find /dev -maxdepth 1 -mindepth 1 -name dri
2026-03-26T19:12:54.527888992Z + '[' -n '' ']'
2026-03-26T19:12:54.527900410Z + set +x
2026-03-26T19:12:54.545238157Z Connection to nextcloud-aio-redis (172.18.0.7) 6379 port [tcp/redis] succeeded!
2026-03-26T19:12:55.478875682Z Appdata is not present. Did you change the datadir after the initial Nextcloud installation? This is not supported!
2026-03-26T19:12:55.478895490Z See https://github.com/nextcloud/all-in-one#how-to-change-the-default-location-of-nextclouds-datadir
2026-03-26T19:12:55.478900703Z If you moved the datadir to an external drive, make sure that the drive is still mounted.
2026-03-26T19:12:55.478914271Z The following was found in the datadir:
2026-03-26T19:12:55.480257244Z total 8
2026-03-26T19:12:55.480266142Z drwxr-x--- 2 www-data root 4096 Mar 26 19:12 .
2026-03-26T19:12:55.480268502Z drwxr-xr-x 1 root     root 4096 Mar 26 19:11 ..