Skip to content

Instantly share code, notes, and snippets.

@daubac402
Last active March 15, 2024 01:23
Show Gist options
  • Save daubac402/ff65851238085f18b0045df4044155b9 to your computer and use it in GitHub Desktop.
Save daubac402/ff65851238085f18b0045df4044155b9 to your computer and use it in GitHub Desktop.
NextCloud in Snap in Raspberry Pi tips

NextCloud in Snap in Raspberry Pi tips

Installation

sudo apt-get update
sudo apt-get upgrade

sudo apt install snapd

sudo snap install nextcloud

# enter http://your_local_raspberry_pi_ip to continue setup

Add trusted new trusted domain to config/config.php

In snap, config file is read only, can't edit directly, need to add like this

# add new domain or IP at the #2 for trusted_domains, may need to increase this index each time you want to add new
sudo snap run nextcloud.occ config:system:set trusted_domains 2 --value=your_new_domain_or_ip

Add TLS (https)

sudo snap run nextcloud.enable-https lets-encrypt

Add external storage (external HDD)

  1. Connect the external hard drive to your server and identify its location. You can use the fdisk -l command to list all connected drives and partitions. The external hard drive will typically be something like /dev/sdb1.
  2. Mount the external hard drive. Replace /dev/sdb1 and /mnt/mydrive with your own values:
sudo mkdir /mnt/mydrive
sudo mount /dev/sdb1 /mnt/mydrive
  1. To ensure the drive is mounted every time the system boots, you'll need to edit /etc/fstab. This step is optional but recommended.
  2. Next, you need to give the www-data user (or whatever user your web server runs as) ownership of the mount point:
sudo chown -R www-data:www-data /mnt/mydrive
  1. Now, you need to enable the external storage app in Nextcloud. Log into your Nextcloud web interface, click on your profile picture in the top-right corner, and go to "Apps". Enable the "External storage support" app.
  2. Finally, go to "Settings" > "External storages" in your Nextcloud web interface. Add a new external storage of type "Local", and enter the mount point (/mnt/mydrive) in the "Configuration" field.

Everything works but .. Raspberry is too slow for serving NextCloud :((((

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment