install nextcloud (owncloud fork) on raspberry pi [raspberrypi2]

updated for 11.0.1

when i took the ready made sd-card from this tutorial for the pi2 and inserted it into a rpi1B (512mb ram) it worked,
but nextcloud was operating slower and it had problems to upload a 250MB file
you can see how much ram you have with running:
free -m

based on:
https://www.canox.net/2016/06/die-eigene-cloud-mit-dem-raspberry-pi-und-nextcloud/
http://zwyuan.github.io/2016/02/02/how-to-set-up-owncloud-on-ubuntu-14.04-lts-server-part-ii/
https://debian-administration.org/article/662/Enabling_HTTP_Strict_Transport_Security_on_debian_servers

https://www.thomas-krenn.com/de/wiki/Absicherung_eines_Debian_Servers
https://blog.jj-it-services.de/apache-web-server-absichern/
https://www.psw-group.de/blog/fruehjahrsputz-apache2-aufraeumen-performance-tunen-absichern/2092
http://freiesoftwareog.org/downloads/OwnCloudAufRaspberryPi.pdf

1) download, write image
2) enable ssh,change password, resize, update, upgrade image
2.3) optional install byobu and liquidprompt (easier to manage the terminal)
3) install nextcloud
4) install no-ip
5) port forwarding in your router
6) install letsencrypt
7) configure apache2
8) setting strong directory permissions
9) do backgroundjobs with cron instead of AJAX
10) install your nextcloud clients on your devices (smartphone, pc)
11) security
—11.0) upgrade nextcloud when a new release arrives
—11.1) check your ssl connection
—11.2) enable fail2ban for logins
—11.3) install ufw (uncomplicated firewall)
—11.4) manually check log files
—11.5) run update && upgrade on a regular basis
12) daily backup nextcloud(rsync data and config directorys to usb-stick)
13) upgrade
—13.a) upgrade manually(if a new version is avaliable, for example from 11.0.1 to 11.0.2)
—13.b) upgrade web based(if a new version is avaliable, for example from 10.0.1 to 10.0.2)
14) nextcloud’s command line
15) other stuff

1) download the latest pi-light image and write it onto a sd card:
download and unzip:

cd ~
wget http://downloads.raspberrypi.org/raspbian_lite_latest -O raspbian_lite_latest.zip
unzip raspbian_lite_latest.zip

check the location of your sd card:
lsblk #mine was on sdb

write the image on the sd card:
replace “2016-05-27” with the actually name of your unzipped image
replace “sdb” with your location of the sd card

sudo dd if=2016-05-27-raspbian-jessie-lite.img of=/dev/sdb status=progress

“status=progress” is only supported after version 8.24 (check it with dd --version)
if your version is an older one just write the command without “status=progress”

2) enable ssh,change password, resize, update, upgrade image:
enable ssh when the sdcard is mounted on a linux pc, based on:
http://www.gtkdb.de/index_36_2894.html
navigate to the boot partition of your sd card then create a ssh file:
sudo touch ssh

ssh into the pi:
ssh pi@raspberrypi # password is “raspberry”
or if that does not work get the ip of your pi with the android app “network discovery”
https://f-droid.org/repository/browse/?fdid=info.lamatricexiste.network
then ssh into your pi with the ip:
ssh pi@the_ip_of_your_pi
for example: ssh pi@192.168.1.70

for security maybe change the default user:
https://jankarres.de/2013/09/raspberry-pi-standard-benutzername-pi-aendern/

change your raspbian password:
passwd

check if your operating system is already expanded to the whole sd card:
df -h #if not expand it in the raspi-config menu sudo raspi-config

update and upgrade the pi:
sudo apt update && sudo apt upgrade -y && sudo reboot

optional update the firmware:
sudo apt install rpi-update

sudo rpi-update

sudo reboot

2.3) optional install byobu and liquidprompt (easier to manage the terminal)
sudo apt install byobu
byobu-enable
get liquidprompt:
cd
git clone https://github.com/nojhan/liquidprompt.git
source liquidprompt/liquidprompt

edit bashrc for liquidprompt:
nano ~/.bashrc
and add at the end:

# Only load Liquid Prompt in interactive shells, not from a script or from scp
[[ $- = *i* ]] && source ~/liquidprompt/liquidprompt

3) install nextcloud:
ssh into the pi:
ssh pi@raspberrypi # with your changed password

install software:
sudo apt install apache2 php5 php5-gd php5-sqlite php5-curl \
php5-common php5-intl php-pear php-apc php-xml-parser \
libapache2-mod-php5 curl libcurl3 libcurl3-dev sqlite -y

download and unzip nextcloud:
cd /var/www/
#sudo wget https://download.nextcloud.com/server/releases/nextcloud-10.0.1.zip
#sudo wget https://download.nextcloud.com/server/releases/nextcloud-11.0.0.zip

sudo wget https://download.nextcloud.com/server/releases/nextcloud-11.0.1.zip
sudo unzip nextcloud-*.zip
sudo rm nextcloud-*.zip

recursive change the owner of /var/www/nextcloud to www-data:
sudo chown -R www-data:www-data /var/www/nextcloud

4) install no-ip:
https://fredfire1.wordpress.com/2016/04/27/install-no-ip-raspberrypi/

5) in your router enable port forwarding 80 and 443
this will make your pi reachable from EVERYWHERE in the world.
If you want to keep your data safe you have to upgrade nextcloud as fast as possible with new upgrades. Otherwise your nextcloud might be on risk for security bugs. You also have to harden your server.
I personally do not recommend to make your server public to the internet. you always have to worry about security.
if you are not a security expert only enable it once for setup for the next steps until you reach step 11) and then REMOVE it like recommended in 11)
for http server:
enable in your router port forwarding for tcp port 80

for https server:
enable in your router port forwarding for tcp port 443

6) install letsencrypt:
#sudo apt install letsencrypt python-letsencrypt-apache
#sudo letsencrypt --apache --agree-tos --email your-email-address -d your-domain.com

install git:
sudo apt install git -y

clone the letsencrypt from github:
cd /etc
sudo git clone https://github.com/letsencrypt/letsencrypt

run the script:
cd /etc/letsencrypt
sudo ./letsencrypt-auto

you will be asked for your your_no_ip.domain.com
if you are asked for https access choose > secure

7) configure apache2:
change ServerSignature and ServerTokens in security.conf:
sudo nano /etc/apache2/conf-enabled/security.conf
#change ServerTokens to Prod (only return Apache in the Server header, returned on every page request

ServerTokens Prod

#change ServerSignature to off (not to display the server version on error pages, or other pages it generates)

ServerSignature Off

restart apache:
sudo service apache2 restart

change in following two files /etc/apache2/sites-available/000-default.conf
and /etc/apache2/sites-available/000-default-le-ssl.conf

DocumentRoot /var/www/html
to
DocumentRoot /var/www/nextcloud

you can do it with a) or b)
a) change it manually with nano:
sudo nano /etc/apache2/sites-available/000-default.conf
sudo nano /etc/apache2/sites-available/000-default-le-ssl.conf

for faster performance also comment out “CustomLog ${APACHE_LOG_DIR}/access.log combined” with a “#” at the beginning in the previous two files and also in /etc/apache2/sites-available/000-default-le-ssl.conf (based on: https://github.com/owncloud/documentation/wiki/Performance-Tuning-%28unofficial%29 )

b)simply use this code snippet:

cd /etc/apache2/sites-available/
sudo sed -i 's:DocumentRoot /var/www/html:DocumentRoot /var/www/nextcloud:g' 000-default.conf
cd /etc/apache2/sites-available/
sudo sed -i 's:DocumentRoot /var/www/html:DocumentRoot /var/www/nextcloud:g' 000-default-le-ssl.conf

change apache2.conf:
sudo nano /etc/apache2/apache2.conf
and add at the end:

<Directory /var/www/nextcloud>
	AllowOverride All
</Directory>

sudo nano /etc/apache2/sites-available/000-default-le-ssl.conf
add the following line

Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains; preload"

one line above

</VirtualHost>

enable module headers:
sudo a2enmod headers
#sudo a2dismod headers

restart apache2:
sudo service apache2 restart

login to your nextcloud installation over your_no_ip.domain.com

to remove the memory cache bug from admin panel:
add in config.php the following line before “;” :
sudo nano /var/www/nextcloud/config/config.php

'memcache.local' => '\OC\Memcache\APC',

restart apache2:
sudo service apache2 restart

8) setting strong directory permissions

based on:
https://docs.nextcloud.org/server/9/admin_manual/installation/source_installation.html#setting-strong-directory-permissions
cd
touch set-nextcloud-permissions.sh
chmod +x set-nextcloud-permissions.sh
nano set-nextcloud-permissions.sh

#!/bin/bash
ncpath='/var/www/nextcloud'
htuser='www-data'
htgroup='www-data'
rootuser='root'

printf "Creating possible missing Directories\n"
mkdir -p $ncpath/data
mkdir -p $ncpath/assets
mkdir -p $ncpath/updater

printf "chmod Files and Directories\n"
find ${ncpath}/ -type f -print0 | xargs -0 chmod 0640
find ${ncpath}/ -type d -print0 | xargs -0 chmod 0750

printf "chown Directories\n"
chown -R ${rootuser}:${htgroup} ${ncpath}/
chown -R ${htuser}:${htgroup} ${ncpath}/apps/
chown -R ${htuser}:${htgroup} ${ncpath}/assets/
chown -R ${htuser}:${htgroup} ${ncpath}/config/
chown -R ${htuser}:${htgroup} ${ncpath}/data/
chown -R ${htuser}:${htgroup} ${ncpath}/themes/
chown -R ${htuser}:${htgroup} ${ncpath}/updater/

chmod +x ${ncpath}/occ

printf "chmod/chown .htaccess\n"
if [ -f ${ncpath}/.htaccess ]
 then
  chmod 0644 ${ncpath}/.htaccess
  chown ${rootuser}:${htgroup} ${ncpath}/.htaccess
fi
if [ -f ${ncpath}/data/.htaccess ]
 then
  chmod 0644 ${ncpath}/data/.htaccess
  chown ${rootuser}:${htgroup} ${ncpath}/data/.htaccess
fi

run the script:
sudo ./set-nextcloud-permissions.sh
rm set-nextcloud-permissions.sh

if you are working in your own network try the_ip_of_your_pi (will be faster)

9) do backgroundjobs with cron instead of AJAX
based on:
https://docs.nextcloud.org/server/9/admin_manual/configuration_server/background_jobs_configuration.html

login in to the adminpanel and change cronjobs from AJAX to Cron:
setup-cron

edit the crontab of www-data:
sudo crontab -u www-data -e
and add at the end:

*/15  *  *  *  * php -f /var/www/nextcloud/cron.php

check the crontab of www-data:
sudo crontab -u www-data -l

10) install your nextcloud clients on your devices (smartphone, pc):
for android:
https://f-droid.org/repository/browse/?fdid=com.nextcloud.client

linux pc:
sudo apt-get install owncloud-client

more:
https://nextcloud.com/install/

nextcloud calDAV, cardDAV:
login into webinterface as admin and enable apps: calendar, contacts
or:
sudo -u www-data php /var/www/nextcloud/occ app:enable contacts &&
sudo -u www-data php /var/www/nextcloud/occ app:enable calendar

on android install davdroid:
https://f-droid.org/repository/browse/?fdid=at.bitfire.davdroid

in the app enter your address of your pi
if you want to use it only in your local lan, use your local lan ip..

if you are migrating from google to nextcloud you can export your calendars:
https://support.google.com/calendar/answer/37111?hl=en

11) security:
this is MOST important. BUT you also have to search for it YOURSELF.

if you are not a security expert best REMOVE port forwarding for ports 80 and 443 from your router like recommended in 5)
so it will ONLY be reachable from your LOCAL network over 192.168.x.x

11.0) upgrade nextcloud when a new release arrives
UPGRADE, UPGRADE, UPGRADE ..otherwise you will miss fixed security bugs..
how to upgrade from an older installation is described in 13)
you can check your security of your current nextcloud version at:
https://scan.nextcloud.com/

11.1) check your ssl connection:
https://www.ssllabs.com/ssltest/analyze.html?d=your_personal_subdomain.noip.com

11.2) enable fail2ban for logins:
based on: https://forum.owncloud.org/viewtopic.php?f=8&t=28678

you can check manually for failed logins:
sudo lastb

install fail2ban:
sudo apt install fail2ban

create a nextcloud.conf:
sudo nano /etc/fail2ban/filter.d/nextcloud.conf

[Definition]
failregex={"reqId":".*","remoteAddr":".*","app":"core","message":"Login failed: '.*' \(Remote IP: '<HOST>'\)","level":2,"time":".*"}

ignoreregex =

create a jail.local:
sudo nano /etc/fail2ban/jail.local

[nextcloud]
enabled = true
filter  = nextcloud
# select http, https or both, depending on which you use:
port    =  http,https
# edit the logpath to your needs:
logpath = /var/www/nextcloud/data/nextcloud.log

start/ reload fail2ban:
sudo service fail2ban start
sudo service fail2ban reload
sudo service fail2ban status

check fail2ban log:
cat /var/log/fail2ban.log

11.3) install ufw (uncomplicated firewall):
sudo apt install ufw

default deny any package:
sudo ufw default deny

maybe disable IPv6: # i dont know if that is usefull or not.. you have to research it yourself..
sudo nano /etc/default/ufw
and change the line 7 to:
IPV6=no

allow from ssh in local lan: if your local lan is not 192.168.1.0/24 , then you have to change that in the following code
sudo ufw allow proto tcp from 192.168.1.0/24 to any port 22

allow port 443 for https from internet:
sudo ufw allow 443/tcp

allow http from local lan:
sudo ufw allow proto tcp from 192.168.1.0/24 to any port 80

enable firewall:
sudo ufw enable

get ufw status:
sudo ufw status

11.4) manually check log files:
Log files of Web Server:
sudo nano /var/log/apache2/access.log #Access Log files (if you did not disable it to speed up apache2)
sudo nano /var/log/apache2/other_vhosts_access.log
sudo nano /var/log/apache2/other_vhosts_access.log.1
sudo zless /var/log/apache2/other_vhosts_access.log.2.gz
sudo zless -S /var/log/apache2/other_vhosts_access.log.2.gz #-S means no linebreak
sudo nano /var/log/apache2/error.log #Error Log files

example to unzip a gz files:
gunzip other_vhosts_access.log.2.gz

clean a log file from unimportant lines (remove all lines from a file that start with “string”):
sed -i '/^string/d' input-file

Log file of nextcloud:
sudo nano /var/www/nextcloud/data/nextcloud.log

if you want to read only the last 10 entrys use:
tail -10 /path/to/log/file

get the version of your nextcloud (simply add a /status.php at the end of the address):
https://192.168.1.x/status.php

see apache2 logs:
sudo su
cd /var/log/apache2/ && ls

11.5) run update && upgrade on a regular basis
run the following code once a week or so:
sudo apt-get update && sudo apt-get upgrade -y
maybe do it with a cronjob.
but be aware, sometimes new software might break your running system, so maybe run it manually so you you will be able to check it directly if it is still working.

install unattended-upgrades:
based on:
https://fredfire1.wordpress.com/2015/11/21/security-debianraspberrypi/

sudo apt-get install unattended-upgrades

change the config:
sudo nano /etc/apt/apt.conf.d/50unattended-upgrades
add after // “o=Raspbian,a=stable”;

//      "o=Raspbian,a=stable";
//      "origin=Raspbian,archive=stable,label=Raspbian-Security";
//      "origin=Raspbian,archive=stable,label=Raspbian";
//      "origin=Raspbian,archive=${distro_codename},label=Raspbian-Security";
//normally the line above was the right one i think.
//the line below uses all updates, but i used it for testing.
      "origin=Raspbian,archive=${distro_codename},label=Raspbian";

create 10periodic with content:
sudo nano /etc/apt/apt.conf.d/10periodic

// Do "apt-get update" automatically every n-days (0=disable)
APT::Periodic::Update-Package-Lists "1";

// Do "apt-get upgrade --download-only" every n-days (0=disable)
APT::Periodic::Download-Upgradeable-Packages "1";

// Do "apt-get autoclean" every n-days (0=disable)
APT::Periodic::AutocleanInterval "7";

// Run the "unattended-upgrade" security upgrade script
// every n-days (0=disabled)
// Requires the package "unattended-upgrades" and will write
// a log in /var/log/unattended-upgrades
APT::Periodic::Unattended-Upgrade "1";

test run for security upgrades:
sudo unattended-upgrades --dry-run

it will be run every day at 6:25 you can change the daily cron in:
/etc/crontab if you like to run it at another time

check logs:
tail -n 4 /var/log/unattended-upgrades/unattended-upgrades.log
or:
nano /var/log/unattended-upgrades/unattended-upgrades.log

12) daily backup nextcloud(rsync data and config directorys to usb-stick):
this daily backup uses rsync, the bad about that is:
do not use doubledots in filenames in owncloud
do not use spaces at the end of a foldername

if you have an idea to avoid rsync rescanning files with that properties let me know.

based on:
https://docs.nextcloud.org/server/9/admin_manual/maintenance/backup.html
https://web.archive.org/web/20160718213138/http://www.mediamarkt.de/de/product/_verbatim-49821-1790733.html
http://www.cenz.at/raspberry#cloud
https://znil.net/?title=EXT4_Festplatte_am_Raspberry_Pi_mounten_und_formatieren#Partition_erstellen

https://jankarres.de/2013/01/raspberry-pi-usb-stick-und-usb-festplatte-einbinden/

i got a “VERBATIM 49821 USB-Stick 16 GB” for 8€ to make the automatic daily nextcloud backup on it.

get the uuid of your usb-stick:
ls -l /dev/disk/by-uuid/
example output:

total 0
lrwxrwxrwx 1 root root 10 Jul 18 18:06 02A2-C123 -> ../../sda1
lrwxrwxrwx 1 root root 15 Jul 18 18:06 6386338e-a090-a090-a090-38638638338e -> ../../mmcblk0p2
lrwxrwxrwx 1 root root 15 Jul 18 18:06 00C1-E113 -> ../../mmcblk0p1

so my usb-stick is on sda1 and has the UUID 02A2-C123
note your UUID

create the folder usbdisk:
sudo mkdir /media/usbdisk

make the user pi the owner of the folder:
sudo chown -R pi:pi /media/usbdisk

add the usb-stick in fstab (so it will be mounted on boot):
sudo nano /etc/fstab
and add at the end of the file the following line, replace 02A2-C123 with your UUID

UUID=02A2-C123 /media/usbdisk vfat utf8,users,rw,uid=pi,gid=pi,nofail 0 0

create a backup script:
cd
touch backup-nextcloud2stick.sh
chmod +x backup-nextcloud2stick.sh
nano backup-nextcloud2stick.sh

#!/bin/bash
#set nexcloud to maintaince mode, stop apache2, backup data and config folders, start apache, disable maintaince mode
(date "+%H:%M:%S--%d.%b.%Y start nextcloud backup") && \
sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --on && \
sleep 5
sudo service apache2 stop && \
sleep 5
sudo rsync -rtuv /var/www/nextcloud/data/ /media/usbdisk/nextcloud-data/ && \
sudo rsync -rtuv /var/www/nextcloud/config/ /media/usbdisk/nextcloud-config/ && \
sleep 5
sudo service apache2 start && \
sleep 5
sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --off && \
(date "+%H:%M:%S--%d.%b.%Y finished nextcloud backup")

add the script to crontab: (so it will run everyday at 1:30)
crontab -e

30 01 * * * /home/pi/backup-nextcloud2stick.sh >> /home/pi/backup2stick.log

the calendars are a part of the sqlite database and will be backup in /media/usbdisk/nextcloud-data/owncloud.db

13) upgrade
if you are using a very old version do not update directly to the latest version!!!
ownCloud and the current Nextcloud releases do not have the the ability to skip releases. This means upgrades have to go through all major releases.
Always start by upgrading to the latest bugfix/security release in your current stable series before moving to the next major release.
To ensure app data is properly migrated you have to update and enable the apps after each step. They are automatically disabled to make sure the server does not break during the upgrade.
Starting ownCloud 8.2.x or Nextcloud 9.0, you can use the new Nextcloud updater, skipping the steps below

for more information about upgrading to a new major release have a look at:
https://nextcloud.com/blog/protect-your-privacy-time-to-upgrade-to-nextcloud-11./

13.a) upgrade manually(if a new version is avaliable, for example from 11.0.1 to 11.0.2)
based on:
https://docs.nextcloud.org/server/9/admin_manual/maintenance/manual_upgrade.html
https://docs.nextcloud.org/server/9/admin_manual/maintenance/update.html#set-updating-permissions-label
https://help.nextcloud.com/t/shell-script-for-backup-and-upgrade-nextcloud-or-owncloud/1131

https://docs.nextcloud.com/server/11/admin_manual/maintenance/manual_upgrade.html

if you just have a small update you can try my steps (for example from 11.0.1 to 11.0.2):
switch to maintaince mode:
sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --on
sudo -u www-data php /var/www/nextcloud/occ app:disable contacts
sudo -u www-data php /var/www/nextcloud/occ app:disable calendar

stop the webserver:
sudo service apache2 stop

rename the old nextcloud folder:
cd /var/www/
sudo mv nextcloud nextcloud_old

get latest nextcloud version:
#sudo wget https://download.nextcloud.com/server/releases/nextcloud-10.0.0.zip
#sudo wget https://download.nextcloud.com/server/releases/nextcloud-10.0.1.zip
#sudo wget https://download.nextcloud.com/server/releases/nextcloud-11.0.0.zip
#sudo wget https://download.nextcloud.com/server/releases/nextcloud-11.0.1.zip

cd /var/www/
sudo wget https://download.nextcloud.com/server/releases/nextcloud-11.0.2.zip
sudo unzip nextcloud-*.zip
sudo rm nextcloud-*.zip

move over the old config.php file and the data directory:
sudo mv /var/www/nextcloud_old/config/config.php /var/www/nextcloud/config/config.php
sudo mv /var/www/nextcloud_old/data /var/www/nextcloud/data

create a script to set permissions for update:
cd
touch nextcloud_upgrade_perms.sh
chmod +x nextcloud_upgrade_perms.sh
nano nextcloud_upgrade_perms.sh

#!/bin/bash
# Sets permissions of the Nextcloud instance for updating

ncpath='/var/www/nextcloud'
htuser='www-data'
htgroup='www-data'

chown -R ${htuser}:${htgroup} ${ncpath}

change the permissions:
sudo ./nextcloud_upgrade_perms.sh
rm nextcloud_upgrade_perms.sh

start the webserver:
sudo service apache2 start

upgrade nextcloud:
sudo -u www-data php /var/www/nextcloud/occ upgrade

stop the webserver:
sudo service apache2 stop

set strong directory permissions:
it is explained in step 8)

start the webserver:
sudo service apache2 start

disable maintaince mode:
sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --off
sudo -u www-data php /var/www/nextcloud/occ -V
sudo -u www-data php /var/www/nextcloud/occ app:enable contacts
sudo -u www-data php /var/www/nextcloud/occ app:enable calendar

if you have setup fail2ban with nextcloud 9.0.53 or previous as i explained it in 11.2), do not forget to do it again, cause the path of the logfile changed from owncloud.log to nextcloud.log

if the update worked also remove the old nextcloud folder:
sudo rm -r /var/www/nextcloud_old

13.b) upgrade web based(if a new version is avaliable, for example from 10.0.1 to 10.0.2)
based on:
https://docs.nextcloud.com/server/11/admin_manual/maintenance/update.html

on website login as with your admin account
click on top right to get the menu
01-admin
choose “Admin”

02-open-updater
click “Open updater”
03-start-update
click “Start update”
it got the error
04-error-update
logged into my pi over ssh
then run:
sudo -s
cd /var/www/nextcloud
rm -r assets

on website run the updater again “Retry update”
got the error check write permissions
05-wrong-write-permissions
best enable maintaince mode first.. so owncloud is not doing important stuff in background
sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --on

connect again over ssh and run in terminal the script nextcloud_upgrade_perms.sh [creating the script is explained in 13)a)]
cd && sudo ./nextcloud_upgrade_perms.sh
and run the updater again “Retry update”
took ~5 minutes on pi2 to get the following site
06-maintaince-mode-switch
now set old perms on owncloud directory [creating the script is explained in 13)a)]:
cd && sudo ./set-nextcloud-permissions.sh
then click on “No (for usage of the web based updater)”
07-finish-update
then click on “Go to back to your Nextcloud instance to finish the update”
08-start-update
“Start update”
done.

14) nextcloud’s command line
based on: https://www.c-rieger.de/using-nextclouds-command-line/
sudo su
cd /var/www/nextcloud

rescan all files of all users:
sudo -u www-data php occ files:scan --all -v

cleanup nextclouds filecache:
sudo -u www-data php occ files:cleanup

cleanup all deleted files:
sudo -u www-data php occ trashbin:cleanup

cleanup files for a user:
sudo -u www-data php occ trashbin:cleanup

list all commands:
sudo -u www-data php occ

15) other stuff
https://github.com/petrockblog/OwncloudPie/blob/master/owncloudpie_setup.sh

Advertisements

11 thoughts on “install nextcloud (owncloud fork) on raspberry pi [raspberrypi2]

  1. Pingback: NextCloud en Raspbian – Mi Raspberry Pi

  2. Excellent document! Much appreciated.

    I’m having problems connecting Nexcloud to my external Toshiba 2T NTFS formatted HDD.
    Upon first sign in on the web, after setting the data folder that points to my HDD, I keep getting “Data directory (/mnt/nextcloud/) is readable for other users. Please change the permissions to 0770 so that the directory cannot be listed by other users.”
    Any ideas or guidelines?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s