Hi All,
I’ve been setting up some self hosted cloud apps on my Umbrel Raspberry Pi install.
So far i’ve got Nextcloud and Immich setup and seemingly working and I can Tailscale into it remotely, which is exactly what I want.
However, I think that Nextcloud is directing itself to the SD card of the Pi rather than to the 1TB drive that I have installed.
I set up Immich and it is working correctly by default and using the external drive, my bitcoin node is also correctly using the drive.
Is anyone able to help me confirm where Nextcloud is saving data to, and how to change it?
I’m not particularly familiar with Linux, so an idiots guide would be really useful.
I’ve got a 4TB drive arriving and I plan to clone my 1TB to it and then expand the volume. I just wanted my cloud hosting working correctly first.
Thanks in advance
To confirm where Nextcloud is saving data on your Umbrel Raspberry Pi and change it to your 1TB external drive, follow these steps. Since you’re not very familiar with Linux, I’ll keep it as simple as possible with clear instructions. This assumes your Nextcloud is installed via the Umbrel App Store, which uses Docker, and your external drive is already mounted and working with other apps like Immich and your Bitcoin node.
Step 1: Confirm Where Nextcloud Is Saving Data
- Access Your Umbrel Pi via SSH: Open a terminal on your computer (e.g., Terminal on macOS/Linux or PowerShell on Windows). Connect to your Pi using SSH. Replace with your Pi’s IP address: ssh umbrel@ Enter the password (default is usually umbrel unless you changed it).
- Check Nextcloud’s Data Directory: Umbrel’s Nextcloud runs in a Docker container, and the data directory is defined in the Docker configuration. Run this command to inspect the Nextcloud Docker container: docker inspect umbrel_nextcloud_nextcloud_1 Look for the Mounts section in the output. It will show where the Nextcloud data is stored. You’ll see something like: “Mounts”: [ { “Type”: “bind”, “Source”: “/home/umbrel/umbrel/app-data/nextcloud/data/nextcloud”, “Destination”: “/var/www/html” }, … ] The Source path (e.g., /home/umbrel/umbrel/app-data/nextcloud/data/nextcloud) is where Nextcloud saves its data on the host (your Pi). If the Source path points to a location on your SD card (e.g., under /home/umbrel/), it’s using the SD card. If it points to your external drive (e.g., /mnt/data/ or /media/umbrel/), it’s already using the external drive.
- Verify Storage Location: To confirm if the data is on the SD card or external drive, check the mount point of the data directory. Run: df -h /home/umbrel/umbrel/app-data/nextcloud/data/nextcloud This shows the filesystem and mount point. If it’s under /dev/mmcblk0p2 (or similar), it’s the SD card. If it’s under /dev/sda1 (or similar) or a path like /mnt/data, it’s your external drive.
Step 2: Change Nextcloud’s Data Directory to the External Drive If Nextcloud is using the SD card, you’ll need to move its data to the external drive. Since Immich and your Bitcoin node are already using the 1TB drive, it’s likely mounted at a path like /mnt/data/ or /media/umbrel/. We’ll use that path.
- Stop the Nextcloud Container: To avoid data corruption, stop the Nextcloud app: docker-compose -f /home/umbrel/umbrel/docker-compose.yml stop nextcloud
- Find Your External Drive’s Mount Point: Run this command to list mounted drives: lsblk Look for your 1TB drive (e.g., /dev/sda1). Note its mount point, likely /mnt/data/ or /media/umbrel/. For example: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 1T 0 disk └─sda1 8:1 0 1T 0 part /mnt/data If it’s not mounted, mount it manually (replace /dev/sda1 with your drive’s device name): sudo mount /dev/sda1 /mnt/data
- Move Nextcloud Data to the External Drive: Create a new directory on the external drive for Nextcloud data: sudo mkdir -p /mnt/data/nextcloud/data Copy the existing Nextcloud data to the new location (replace the source path with the one from Step 1): sudo cp -r /home/umbrel/umbrel/app-data/nextcloud/data/nextcloud/* /mnt/data/nextcloud/data/ Set proper permissions for the new directory (Nextcloud runs as the www-data user in the container): sudo chown -R 33:33 /mnt/data/nextcloud/data sudo chmod -R 750 /mnt/data/nextcloud/data
- Update the Docker Configuration: Edit the Nextcloud Docker configuration file: sudo nano /home/umbrel/umbrel/app-data/nextcloud/docker-compose.yml Find the volumes section for the Nextcloud service. It might look like: volumes:
- ./data/nextcloud:/var/www/html Change the source path to the new location on the external drive: volumes:
- /mnt/data/nextcloud/data:/var/www/html Save the file (Ctrl+O, Enter, Ctrl+X).
- Restart Nextcloud: Start the Nextcloud app again: docker-compose -f /home/umbrel/umbrel/docker-compose.yml up -d nextcloud
- Verify the Change: Log in to Nextcloud via your browser or Tailscale. Upload a test file and check if it appears in the new directory: ls /mnt/data/nextcloud/data//files/ If the file is there, the data directory is correctly set to the external drive.
Step 3: Prepare for Cloning to the 4TB Drive Since you plan to clone your 1TB drive to a 4TB drive and expand the volume, ensure Nextcloud is working correctly on the 1TB drive first. Once confirmed: Clone the Drive: Use a tool like dd or rsync to clone the 1TB drive to the 4TB drive. For example, with dd (replace /dev/sda and /dev/sdb with your 1TB and 4TB drive device names): sudo dd if=/dev/sda of=/dev/sdb bs=64K conv=noerror,sync status=progress This can take hours, so be patient. Expand the Partition: After cloning, use a tool like gparted or parted to resize the partition on the 4TB drive to use the full capacity. Remount the 4TB drive at the same mount point (e.g., /mnt/data). Update Nextcloud: Ensure the docker-compose.yml still points to the correct path (e.g., /mnt/data/nextcloud/data). Restart Nextcloud as in Step 5.
Troubleshooting Tips Permission Errors: If Nextcloud can’t write to the external drive, recheck permissions: sudo chown -R 33:33 /mnt/data/nextcloud/data sudo chmod -R 750 /mnt/data/nextcloud/data Nextcloud Not Starting: Check Docker logs for errors: docker logs umbrel_nextcloud_nextcloud_1 Drive Not Mounted: Ensure the external drive mounts automatically at boot by adding it to /etc/fstab. Edit the file: sudo nano /etc/fstab Add a line like (replace /dev/sda1 and filesystem type as needed): /dev/sda1 /mnt/data ext4 defaults,nofail 0 2 Test the mount: sudo mount -a
Notes Backup First: Before moving data or cloning drives, back up your Nextcloud data to avoid accidental loss. Filesystem: Ensure your 1TB and 4TB drives use a Linux-compatible filesystem like ext4 or Btrfs, not NTFS or exFAT, as these don’t support Linux permissions properly. Umbrel Specifics: Umbrel’s Docker setup simplifies some aspects but requires editing the docker-compose.yml file to change data paths. Immich/Bitcoin Reference: Since Immich and your Bitcoin node are using the external drive, their docker-compose.yml files (in /home/umbrel/umbrel/app-data/immich/ and /home/umbrel/umbrel/app-data/bitcoin/) can confirm the correct mount point (e.g., /mnt/data).
1 Like
Thank you for such a comprehensive guide!
I’ll be able to spend time with this tomorrow so I’ll be able to confirm everything is working.
Fortunately, as I wanted to ensure everything was working correctly I haven’t uploaded any files that I can’t afford to lose. I have copies locally on my Windows pc and can re upload as required.
Thanks again
J
Well, Partial success. I managed to get the drive copied. It does appear that the Nextcloud data was on the SSD, it just appeared that there was less space available than was showing in the storage info on umbrel.
After cloning the drive and expanding, when plugging the drive into the raspberry Pi it looked like a fresh install. As I didn’t have any data I didn’t have a backup for I’m just going to let the bitcoin node sync again, restore the wallet and set up Immich and Nextcloud again and upload the data to it.
Not sure why it didn’t pick up the old install, but it’s not the end of the world.
Thanks for your help @gringoperdido.
The only change that I had to make to your initial instruction was regarding the Docker inspect, there was no ‘umbrel_nextcloud_nextcloud_1’ found, I had to use the ‘docker inspect nextcloud_web_1’ command, hopefully that helps someone looking to do this in the future.
Thanks
J
cool, glad you got it going. yah, those docker commands are hit and miss. I don’t run that so it was a guess. 
Hey there I think I can help you with this, as at the time I had to migrate my storage from Raspberry to a Mini PC which is now hosting umbrel, including Nextcloud of course.
This is how I documented it at the time, hope it helps.
Files moved to Nextcloud folder but it doesn’t detect them.
This happens because Nextcloud doesn’t scan the local directory it only takes into account the files strictly uploaded to it, so id doesn’t show them on the web server:
This is solved by running:
sudo docker exec -u www-data -it nextcloud_web_1 php occ files:scan --all