Hi there!
You need to create a bind mount that connects your external drive (on the host system) to a path inside the Nextcloud container. Here’s how to do it properly:
- First, make sure your external drive has the correct permissions:
sudo chown -R www-data:www-data /media/WD
sudo chmod 750 /media/WD
- Then modify your Docker configuration to include the bind mount:
In the CasaOS App Settings for Nextcloud, add a new volume:
/media/WD:/data/WD # or another appropriate path inside the container
For BigBearCasaOS users, you could alternatively mount directly to:
/media/WD:/var/www/html/data/WD # mounts to the Nextcloud data directory
Or you could move everything to the external hard drive:
-
After making these changes, restart your container.
-
You might need to run a file scan:
docker exec -u www-data nextcloud php occ files:scan --all
Important tips:
- Avoid mounting directly to Nextcloud’s main data directory to prevent data loss during container rebuilds
- Consider using the External Storage app in Nextcloud as an alternative approach
- If your drive is NTFS/FAT32, you might face permission issues - EXT4 works better with Linux containers
- Make sure your external drive mounts automatically at boot time by using fstab.