Looking to install nextcloud using what?

Hey all, I am posting this after messing up with one nextcloud server which i had installed using snap and now i am unable to get my data back but luckily i was having it all so no need to worry for that.
Coming to the point I am looking for a way by which i can easily install nextcloud into my raspberry pi like using docker or snap etc…But I have an condition that my all data needs to be get stored in different usb drive which i’ll keep connected to it. Also one more thing if anything goes wrong i can just plug the usb drive into my pc and have my data back.

Can someone please help me in doing so ??


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 !!

  1. Update the Server
sudo apt update && apt upgrade -y
sudo reboot
  1. 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

  1. Mount your External Storage in your OS

  2. Connect (Allow) NextCloud to with External Storage

sudo snap connect nextcloud:removable-media
  1. 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

  1. Move the existing stuff
sudo mv /var/snap/nextcloud/common/nextcloud/data /your/external/drive/location
  1. 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)

  1. Start the NextCloud and Reboot the Server
sudo snap start nextcloud
sudo reboot

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.


1 Like

I’d personally recommend Nextcloud AIO, Nextcloud VM or NextcloudPi but I guess I am also a bit biased here :sweat_smile:

1 Like

Thank you so much i will try it now