Skip to content

Instantly share code, notes, and snippets.

@shivasiddharth
Last active November 22, 2020 05:38
Show Gist options
  • Save shivasiddharth/58a453eebae06f2062bb19d2e9724301 to your computer and use it in GitHub Desktop.
Save shivasiddharth/58a453eebae06f2062bb19d2e9724301 to your computer and use it in GitHub Desktop.
How to install Nextcoud in Raspberry, Linux Mint or other Linux based systems.
1. Install snap:
#Do not worry if the below command says no file or directory
sudo rm /etc/apt/preferences.d/nosnap.pref
sudo apt-get update
sudo apt-get install snapd
#For Raspberry Pi Users alone:
sudo nano /etc/ld.so.preload
Comment the line that says /usr/lib/arm-linux-gnueabihf/libarmmem.so
sudo snap install snap-store
2. Install nextcloud:
sudo snap install core
sudo snap install nextcloud
sudo nextcloud.manual-install ADD_YOUR_USERNAME_HERE ADD_YOUR_PASSWORD_HERE
sudo ufw allow 80,443/tcp
3. If you want to change the data to a external drive follow the instructions below, else skip:
a. Format the external drive as ext4. Do not cut corners, NTFS or FAT32 will not work.
b. Insert the drive and get the name of the drive.
c. Change permissions of the drive
sudo chown -R 0770 PATH_TO_YOUR_DRIVE
c. Now we need to change the config
#Stop nextcloud
sudo snap stop nextcloud
#Change the config
sudo nano /var/snap/nextcloud/current/nextcloud/config/config.php
#Scroll over to 'datadirectory' and change the path against that value and save.
d. #Move existing data to the external drive
sudo mv /var/snap/nextcloud/common/nextcloud/data PATH_TO_YOUR_EXTERNAL_DRIVE
e. Restart nextcloud
sudo snap start nextcloud
4. Setting HTTPS access:
a. Stop nextcloud
sudo snap stop nextcloud
b. Generating self signed certificates
sudo nextcloud.enable-https self-signed
5. Adding trusted domain:
a. Get your ip address of the board/computer
#Note the IP Address from the below command
ifconfig
b. sudo snap disable nextcloud
c. sudo snap enable nextcloud
d. sudo nextcloud.occ config:system:set trusted_domains 1 --value=PLACE_THAT_PREVIOUSLY_NOTED_IPADDRESS_HERE
6. Restart nexcloud:
sudo snap start nextcloud
sudo snap restart nextcloud
7. All done now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment