Skip to content

Instantly share code, notes, and snippets.

@NuroDev
Last active June 22, 2019 22:15
Show Gist options
  • Save NuroDev/1579804a0b98646699ffd48c996f8122 to your computer and use it in GitHub Desktop.
Save NuroDev/1579804a0b98646699ffd48c996f8122 to your computer and use it in GitHub Desktop.
Script to download and install NextCloud for Raspberry Pi
sudo apt-get update && sudo apt-get upgrade && sudo apt-get install apache2 php5 php5-gd sqlite php5-sqlite php5-curl -y && sudo service apache2 restart && cd /var/www/html && sudo wget https://download.nextcloud.com/server/releases/nextcloud-12.0.2.zip && sudo unzip -q nextcloud-12.0.2.zip && sudo rm -rf ./nextcloud-12.0.2.zip && sudo mkdir -p /var/www/html/nextcloud/data && sudo chown www-data:www-data /var/www/html/nextcloud/data && sudo chmod 750 /var/www/html/nextcloud/data && cd /var/www/html/nextcloud && sudo chown www-data:www-data config apps && sudo reboot
@NuroDev
Copy link
Author

NuroDev commented Sep 4, 2017

WARNING:

This script has only been tested on Raspberry Pi 3. 2nd generation, 1st generation & Pi Zero is yet to be tested.
Please use the latest version of Raspbian available. Download Raspbian here.

After running the script you can go open NextCloud by going to the following url:

http://YOUR_IP_ADDRESS_HERE/nextcloud

Example:

http://192.168.1.10/nextcloud

Change data directory:

To change the data directory, you will need to move/copy the currently set up data folder to the new location and then update the NextCloud config file.

sudo mv -v /var/www/html/nextcloud/data /YOUR_NEW_DIRECTORY_HERE
sudo nano /var/www/html/nextcloud/config/config.php

When this file has been opened in your nano editor, change the 'datadirectory' value from '/var/www/html/nextcloud/data' to your new directory path. EG: /media/nextcloud_data

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