I guess you are well aware of the fact that there are different ways of installation NextCloud. Easy of hard is the very subjective way to describe this since different people may prefer different installation. Depending on your previous technical abilities, one method may feel easier than another.
For example, I would choose snap because for me since for a non technical user like me, snap feels the easiest !!
- Update the Server
sudo apt update && apt upgrade -y
- Install the Snap NextCloud
sudo snap install nextcloud
sudo nextcloud.manual-install username password
sudo nextcloud.occ config:system:set trusted_domains 1 --value=192.168.xx.xx
sudo nextcloud.occ config:system:set trusted_domains 2 --value=sub.domain.com
Replace the username password with your own and use own (server’s) IP Address
Mount your External Storage in your OS
Connect (Allow) NextCloud to with External Storage
sudo snap connect nextcloud:removable-media
- Change the Default NextCloud Data Directory Location in Config File
sudo snap stop nextcloud
sudo nano /var/snap/nextcloud/current/nextcloud/config/config.php
Here, find an entry called DataDirectory → There change the default location with your external mounted storage directory location
- Move the existing stuff
sudo mv /var/snap/nextcloud/common/nextcloud/data /your/external/drive/location
- Fix the permission
sudo chown -R root:root /your/external/drive/location
sudo chmod 0770 /your/external/drive/location
(I am not sure but you may want to reduce the permission to more secure 755 or such. I haven’t tried, this works for me atleast but may not be very secure)
- Start the NextCloud and Reboot the Server
sudo snap start nextcloud
Now all your data will be saved under your external USB drive and without any issue you can stop the server, unplug the drive and access it in some other computer.
Remember, NextCloud is not just plug n play. Use the USB drive with caution since if you happen to mess up the file and folder permissions, your server may not be able to reuse it.