symlink for appdata folder not working

  • Nextcloud Server version (e.g., 29.x.x):
    • Nextcloud 32.0.5 (nextcloud-aio docker container)
  • Operating system and version (e.g., Ubuntu 24.04):
    • Debian 13.3
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • AIO

Hello,

I run nextcloud-aio on a Debian (which is installed on proxmox, but it shouldn’t matter here).

The system runs on a fast SSD, the data is stored on an HDD. Now want to put my appdata folder to the root partition, to have it on the SSD.

I already read some different threads and a symlink seems the way to go. So I copied the appdata folder to the root directory, created a symlink on the host system and set ‘localstorage.allowsymlinks’ => true in config.php.

When I start nextcloud now, the nextcloud-aio-nextcloud container fails to start with

Appdata is not present. Did you change the datadir after the initial Nextcloud installation? This is not supported!See https://github.com/nextcloud/all-in-one#how-to-change-the-default-location-of-nextclouds-datadirIf you moved the datadir to an external drive, make sure that the drive is still mounted.
The following was found in the datadir:
total 49
drwxr-x--- 5 www-data root       11 Mar  7 17:36 .
drwxr-xr-x 1 root     root     4096 Feb  1 12:59 ..
-rw-r--r-- 1 www-data www-data  542 Feb  1 13:00 .htaccess
-rw-r--r-- 1 www-data www-data   52 Feb  1 13:00 .ncdata
drwxr-xr-x 4 www-data www-data    4 Feb  1 13:02 admin
lrwxrwxrwx 1 www-data www-data   22 Mar  7 17:01 appdata_oc97qixfyh77 -> /appdata_oc97qixfyh77/
-rw-r--r-- 1 www-data www-data    0 Feb  1 13:00 audit.log
-rw-r--r-- 1 www-data www-data    0 Feb  1 13:00 index.html
-rw-r--r-- 1 www-data www-data    0 Feb  1 13:00 nextcloud.log
drwxr-xr-x 3 www-data www-data    3 Feb 15 13:55 <user1>

So the link is present, but for some reason nextcloud is still missing something. What am I doing wrong?

Oh and no worries about the 0777 permissions of the appdata folder, I wanted to make sure this is not the point. The appdata folder on the root drive has also 0777. As soon as it is running, I will set proper permissions. :slight_smile:

Thank you in advance!

AIO is running Nextcloud in a Docker container, so your underlying host volumes aren’t mounted within the container(s).

Post your Compose.

AIO does support doing this with the entire data directory, but it may be a bit challenging to do your specific scenario (i.e. just the appdata folder) though with AIO due to the architecture.

I see…I had the naive assumption that the link is on filesystem level and also valid in the docker container.

My compose.yaml:

services:
  nextcloud-aio-mastercontainer:
    image: nextcloud/all-in-one:latest
    restart: always
    container_name: nextcloud-aio-mastercontainer
    volumes:
      - nextcloud_aio_mastercontainer:/mnt/docker-aio-config
      - /var/run/docker.sock:/var/run/docker.sock:ro
    ports:
      - 8080:8080
    environment:
      - APACHE_PORT=11000
      - NEXTCLOUD_DATADIR=/zfs0/nextcloud/data
volumes:
  nextcloud_aio_mastercontainer:
    name: nextcloud_aio_mastercontainer

Hi, I think a bind mount on system level might work instead of the symlink. Can you try that and report back if it works?

A bind mount is working, thank you for your help!

Great! Would you mind sharing the bind mount config that you used? This might be valuable for people searching for the same solution. Thanks in advance! :slight_smile:

Sure. Just put this line in your /etc/fstab:

/appdata_<your_instanceid> /path/to/ssd/dir none bind 0 0

To mount the directory instantly, execute “mount -a”.