Confused about storage (How to tell Nextcloud where to store files?)

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 35.0.1
  • Operating system and version (e.g., Ubuntu 24.04):
    • Ubuntu 26.04.1 LTS
  • Web server and version (e.g, Apache 2.4.25):
    • Not sure how to tell?
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • Caddy
  • PHP version (e.g, 8.3):
    • 8.4.26
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • as soon as I put in the SMTP info
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • AIO
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

  1. Despite the AIO container being on the drive where I want the files to be store (container was created at /mnt/data/Containers/Nextcloud) it seems to be syncing to (I think?) my primary drive (512GB) where the OS is installed instead of my 4TB secondary drive. How do I make it sync to the larger drive instead? The larger drive is mounted at /mnt/data.

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

  1. Install AIO docker container on drive where you want the files to be installed.

  2. It seems to be detecting/using storage on a different drive (the OS host drive) instead of where the container compose.yml is located.

I feel like it’s something I need to do in the compose file, but have no idea how to go about doing that:

volumes:
  - nextcloud_aio_mastercontainer:/mnt/docker-aio-config
  - /var/run/docker.sock:/var/run/docker.sock:ro

I decided to give up and start over. I found some info that said you can mount a volume to /mnt/ncdata and then point Nextcloud there using NEXTCLOUD_DATADIR: - so I deleted all of the docker volumes for nextcloud and then started with a different compose.yml (after creating a new partition and having it automount to /mnt/ncdata at startup)

services:
  nextcloud-aio-mastercontainer:
    image: nextcloud/all-in-one:latest
    container_name: nextcloud-aio-mastercontainer
    restart: always
    ports:
      - "8080:8080"
    environment:
      APACHE_PORT: 11000
      APACHE_IP_BINDING: 0.0.0.0
      NC_DOMAIN: cloud.mydomain.com
      NEXTCLOUD_DATADIR: nextcloud_aio_nextcloud_datadir
    volumes:
      - nextcloud_aio_mastercontainer:/mnt/docker-aio-config
      - nextcloud_aio_nextcloud_datadir:/mnt/ncdata
      - /var/run/docker.sock:/var/run/docker.sock:ro
    extra_hosts:
      - "host.docker.internal:host-gateway"

volumes:
  nextcloud_aio_mastercontainer:
    name: nextcloud_aio_mastercontainer
  nextcloud_aio_nextcloud_datadir:
    name: nextcloud_aio_nextcloud_datadir

About to start it up and see if it puts the data where I want it this time around :crossed_fingers:

Well crap, this did NOT work. It’s still showing the storage on my main OS drive instead of the 4TB drive in admin settings (System). Maybe I’m bad at searching, but I can’t seem to find where in the documentation it tells you where to tell it where you want your storage located either?

Can anyone point me in the right direction?

Alright, I think I’ve done it (maybe?):

Seems to be showing both now, which is a step forward - I guess it’s okay that it’s still showing the OS drive too? I’ll start adding files and see which one fills up, but if it’s a success - this was the change to the compose.yml that was needed:

services:
  nextcloud-aio-mastercontainer:
    image: nextcloud/all-in-one:latest
    container_name: nextcloud-aio-mastercontainer
    restart: always
    ports:
      - "8080:8080"
    environment:
      APACHE_PORT: 11000
      APACHE_IP_BINDING: 0.0.0.0
      NC_DOMAIN: cloud.mydomain.com
      NEXTCLOUD_DATADIR: nextcloud_aio_nextcloud_datadir
    volumes:
      - nextcloud_aio_mastercontainer:/mnt/docker-aio-config
      - nextcloud_aio_nextcloud_datadir:/mnt/ncdata
      - /var/run/docker.sock:/var/run/docker.sock:ro
    extra_hosts:
      - "host.docker.internal:host-gateway"

volumes:
  nextcloud_aio_mastercontainer:
    name: nextcloud_aio_mastercontainer

  nextcloud_aio_nextcloud_datadir:
    name: nextcloud_aio_nextcloud_datadir
    driver: local
    driver_opts:
      type: none
      o: bind
      device: /mnt/ncdata

EDIT: Seems to be working! I’ll mark this as the solution.