Connecting a USB SSD to Docker/nextcloudpi on Ubuntu host

I want to move my old NCP setup to a retired laptop. On the pi I have the data directory on a USB attached SSD. For my new server, I want to run the NCP/Docker implementation and continue to use the USB SSD hard disk. Obviously this requires that I make the SSD available to the Container. I have been experimenting using the --DEVICES and --PRIVILEGED flags, so far unsuccessfully. Anyone have any instructions to offer? The ‘new’ pc is running UBUNTU 22.04, with docker setup and functional. The SSD is mounted via fstab, and works fine from the host os.

@fractal815
You can mount your data using the -v (volume) option when creating the container, for example:

-v /path/on/your/host/to/nc-data:/path/inside/the/container/to/nc-data

1 Like

Thank you Oliver !

So the default datadir path within the application is “/data/nextcloud/data” . This appears to be relative to the root (/) of the container. If I mount the external drive to /media/USBdrive, ie -v=/media/USBdrive/ncdata:/media/USBdrive/ncdata I can then ls the folder from within the container. How can I then change the nextcloud config for datadir to /media/USBdrive/ncdata? nc-datadir does not work in the Docker version, and from the Nextcloudpi Panel I can not seem to change the parameter either. Am I missing something?