IMPORTANT: The contents of this blog post are a detailed explanation of NextCloudPi. However, the main landing page of the project is now nextcloudpi.com and that is the place where information will be kept up to date.
I would like to introduce NextCloudPi, ready to use Raspbian 9 image with the latest Nextcloud 13.
NextCloudPi is now also available as an ARM or x86 docker container ( NEW 06-08-2017 )
NextCloudPi can now also be installed on any Debian 9 system ( NEW 11-12-2017 )
NextCloudPi can also be built for Armbian supported boards, like the Odroid HC1 ( NEW 12-04-2017 ).
NextCloudPi is an official NextCloud community project as of 05-31-2017.
Features:
- Debian 9 stretch
- Nextcloud 13.0.2
- Apache 2.4.25, with HTTP2 enabled
- PHP 7.0 (double the speed of PHP5!)
- MariaDB 10
- Redis memory cache ( NEW 11-12-2017 )
- 4.9 Linux Kernel ( NEW 03-13-2017 )
- Automatic redirection to HTTPS
- ACPU PHP cache
- PHP Zend OPcache enabled with file cache
- HSTS
- Cron jobs for Nextcloud
- Sane configuration defaults
- Pre-installed popular Apps for home use ( calendar, contacts, notes, tasks, news … )
- Full emoji support ( NEW 05-24-2017 )
- Postfix email
- Secure
Extras:
- Setup wizard ( NEW 09-27-2017 )
- NextCloudPi Web Panel ( NEW 07-24-2017 )
- ncp-config tool for easy setup ( RAM logs, USB drive and more )
- Wi-Fi ready ( NEW 03-31-2017 )
- Ram logs ( NEW 03-31-2017 )
- Automatic security updates, activated by default. ( NEW 03-21-2017 )
- Let’s Encrypt for trusted HTTPS certificates.( NEW 03-16-2017 )
- Fail2Ban protection against brute force attacks. ( NEW 02-24-2017 )
- UFW firewall ( NEW 07-02-2018 )
- Dynamic DNS support for no-ip.org ( NEW 03-05-2017 )
- Dynamic DNS support for freeDNS ( NEW 09-05-2017 )
- Dynamic DNS support for duckDNS ( NEW 09-27-2017 )
- Dynamic DNS support for spDYN ( NEW 11-12-2017 )
- dnsmasq DNS server with DNS cache ( NEW 03-09-2017 )
- ModSecurity Web Application Firewall ( NEW 03-23-2017 )
- NFS ready to mount your files over LAN ( NEW 04-13-2017 )
- SAMBA ready to share your files with Windows/Mac/Linux ( NEW 04-16-2017 )
- USB automount ( NEW 05-24-2017 )
- Remote updates ( NEW 03-31-2017 )
- Automatic NCP updates ( NEW 08-16-2017 )
- Automatic Nextcloud updates ( NEW 05-29-2018 )
- Update notifications ( NEW 08-16-2017 )
- NextCloud backup and restore ( NEW 05-24-2017 )
- NextCloud online installation ( NEW 05-24-2017 )
- Format USB drive to BTRFS ( NEW 07-03-2017 )
- BTRFS snapshots ( NEW 04-12-2017 )
- Automatic BTRFS snapshots ( NEW 07-02-2018 )
- BTRFS snapshot auto sync ( NEW 19-03-2018 )
- Scheduled rsync ( NEW 19-03-2018 )
- UPnP automatic port forwarding ( NEW 07-03-2017 )
- Security audits with Lynis and Debsecan ( NEW 07-02-2018 )
- ZRAM ( NEW 19-03-2018 )
Extras are not activated by default. Configure them with sudo nextcloudpi-config
Get it
Please, if possible use and share the torrent to keep the hosting costs down.
At this moment, the images do not provide a desktop environment, though it can be added through apt.
Please, report any issues here.
Use the official forums to ask questions, opinions and participate.
Please, before asking technical questions in the forums, take a look at the FAQ and the wiki.
We need your help! There are many easy things that you can do to contribute.
Installation
NEW: you can follow the installation and setup steps in the Wiki
SD card for the Raspberry Pi
Follow the classic instructions to copy the image to an SD card.
tar -xvf NextCloudPi-lite_02-12-17.tar.bz2 sudo dd bs=4M if=NextCloudPi-lite_02-12-17.img of=/dev/sdx
Replace sdx to your SD card device.
Windows users can install the image with Etcher as explained in this post.
Installer
You can install it in any architecture running the latest Debian with
# curl -sSL https://raw.githubusercontent.com/nextcloud/nextcloudpi/master/install.sh | bash
Usage
NEW: you can follow the installation and setup steps in the Wiki
Connectivity and basic setup
Upon first boot, you should do the usual, such as change the default Raspbian password, maybe configure the network connection, enlarge the partition with raspi-config , and enable SSH if you so desire.
If you are going to connect though a network cable, make sure it is plugged in before turning the Raspberry Pi on. If you are doing manual configuration of the network, such as setting up a static IP, reboot when you are done so that NextCloudPi can detect it.
In many cases you can just access by typing nextcloudpi.local in your browser. Otherwise, you need to discover what is your Raspberry Pi IP address. For this, you can use a network scanner such as nmap
$ nmap -sP '192.168.0.*' Starting Nmap 7.50 ( https://nmap.org ) at 2017-07-24 17:30 CEST Nmap scan report for 192.168.0.131 Host is up (0.017s latency). Nmap done: 256 IP addresses (1 hosts up) scanned in 3.33 seconds
, or you can read it from the screen if you have an HDMI monitor connected during power on. If you use Windows, you can use Angry IP Scanner.
You can connect to your home Wi-Fi through nextcloudpi-config
You can access your private Nextcloud just typing the IP or URL in the navigation bar of your browser. It will redirect you to the HTTPS site
https://<rpi_ip_or_url>
The admin user is ncp, and the default password is ownyourbits. Login to create users, change default password and other configurations.
You can access the NextCloudPi web panel in HTTPS port 4443. The username is ncp and the password is ownyourbits.
https://<rpi_ip_or_url>:4443
The first run, the easiest is to run the configuration wizard. This is the whole process
USB external drive
By default, your data will be kept in your SD card. You will probably want to connect an external USB drive to your Raspberry Pi in order to host your files.
First, you can format your external drive with the nc-format-USB feature. FAT32 or NTFS filesystems are not supported.
Then, you can enable the nc-automount feature. This will result in your drives being auto-mounted to /media
Finally, set your Nextcloud data folder in the drive using nc-datadir.
Access from outside
In order to access your private cloud from the internet, you should setup a Dynamic DNS, so you can use a domain name that doesn’t change with your public IP.
I use no-ip free plan for my DDNS. The no-ip service is integrated in NextCloudPi.
Also, you need to setup port forwarding in your router so your router sends connections to your Raspberry Pi. For this, you can use the nc-forward-ports feature ( details ).
You can explore some alternative ways of accessing your files in this post.
Get a trusted certificate
If you want to avoid the “Untrusted Certificate” warning and make everyone’s life easier, get a Let’s Encrypt signed certificate for your DNS domain through nextcloudpi-config or the web interface.
More extras
You can activate and configure the system and any extras from the web interface.
You can also do so from the command line with
sudo nextcloudpi-config
Follow the wiki or the dedicated posts on this blog for details on each entry.
Apache logs for Nextcloud are located at /var/www/nextcloud/data/{access,error}.log .
Updating
Please, keep in mind that you will be exposing your own private data to the internet and you are the only person responsible for its security. Update your system frequently to get the latest security updates.
Upon login, you will be notified for new NextCloudPi updates
in order to upgrade to the latest version, type
sudo ncp-update
Try it on QEMU first
You can try NextCloudPi first with qemu-pi.sh from the last post
sudo ./qemu-pi.sh NextCloudPi_03-13-17.img
Details
Nextcloud is awesome. It allows us to own and control our information without relying on external companies. These companies could change things outside of our control or even shut down the service and we realize only too late that we do not own the software that we use. Nextcloud is certainly a huge tool to protect our privacy and our data.
The big issue though is that it is a web service, so it needs to run on top of an operating system. Setting that up implies long hours of installation, dealing with package versions, configuration and troubleshooting. Many people are not willing or do not have the knowledge to accomplish this task, and I think it is a big reason why it is not that popular outside of the geek niche.
I thought it would help to facilitate already configured images to the public with Nextcloud included, so I automated the process. Let’s go for it!
In the last post we learned how to use qemu-pi.sh to launch Raspbian on a QEMU virtual machine. We will use this to automatically generate a Raspbian image with Nextcloud 12 installed.
I recommend to setup qemu-pi.sh to use a static MAC address so you can always get the same IP through DHCP after each reboot. This is important to automate the process, and for that reason it comes as the default configuration.
Write down the IP that your Raspbian gets from DHCP, and launch
git clone https://github.com/nextcloud/nextcloudpi.git cd nextcloudpi ./batch.sh 192.168.0.145 # change to your QEMU raspbian IP
This will get the code from github, and
- Download latest Raspbian image.
- Resize the partition.
- Update the system.
- Install Apache with HTTP2, PHP7, Mariadb and all that is needed to run Nextcloud.
- Install Nextcloud.
- Configure the system.
You can use your own image by setting DOWNLOAD=0 at the top of the script. You can also choose between Raspbian or Raspbian Lite by setting the IMG variable. See the code for details.
At the end of the process you end up with an image that you can write on an SD card and use on your Raspberry Pi.
The good thing about this method is that it is an automated process, so we can easily produce newer versions as Raspbian, Apache and Nextcloud receive updates.
Also note that you can change the following parameters at the top of install-nextcloud.sh
ADMINUSER=admin DBADMIN=ncadmin DBPASSWD=ownyourbits MAX_FILESIZE=1G
This was tested on Raspberry Pi 2 and Raspberry Pi 3.
Screenshots
The basic configuration and optimizations are already in place, so there are no warnings on the Admin section. We can see that we are using the recommended cron method.

Also, you can see the default maximum upload size to a sane value of 1G by default. PHP operations time out at one hour. This is important to allow for long uploads and downloads for big files or slow connections.

In order to test that you are using HTTP2, look for X-Firefox-Spdy: h2 in the network tab.

PHP configuration


If you have ever manually configured a Nextcloud instance, the auto-configuration parameters by default are equivalent to this

Code
#!/bin/bash # Nextcloud installation on Raspbian through SSH # Tested with 2017-01-11-raspbian-jessie.img (and lite) # # Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com> # GPL licensed (see end of file) * Use at your own risk! # # Usage: # cat install-nextcloud.sh | sshpass -praspberry ssh pi@$IP # # Notes: # Upon each necessary restart, the system will cut the SSH session, therefore # it is required to save the state of the installation. See variable $STATE_FILE # It will be necessary to invoke this a number of times for a complete installation sudo su VER=11.0.1 ADMINUSER=admin DBADMIN=ncadmin DBPASSWD=ownyourbits MAX_FILESIZE=1G STATE_FILE=/home/pi/.installation_state set -x set -e test -f $STATE_FILE && STATE=$( cat $STATE_FILE 2>/dev/null ) if [ "$STATE" == "" ]; then # RESIZE IMAGE ########################################## SECTOR=$( fdisk -l /dev/sda | grep Linux | awk '{ print $2 }' ) set +e echo -e "d\n2\nn\np\n2\n$SECTOR\n\nw\n" | fdisk /dev/sda set -e echo 0 > $STATE_FILE reboot elif [ "$STATE" == "0" ]; then # UPDATE EVERYTHING ########################################## resize2fs /dev/sda2 apt-get update apt-get upgrade -y apt-get dist-upgrade -y apt-get autoremove echo 1 > $STATE_FILE reboot elif [ "$STATE" == "1" ]; then # GET STRETCH SOURCES FOR HTTP2 AND PHP7 ########################################## echo "deb http://mirrordirector.raspbian.org/raspbian/ stretch main contrib non-free rpi" >> /etc/apt/sources.list cat > /etc/apt/preferences <<EOF Package: * Pin: release n=jessie Pin-Priority: 600 EOF apt-get update # INSTALL FROM STRETCH ########################################## apt-get install -t stretch apache2 -y apt-get install -t stretch php7.0 php7.0-curl php7.0-gd php7.0-fpm php7.0-cli php7.0-opcache php7.0-mbstring php7.0-xml php7.0-zip -y apt-get install php7.0-APC -y apt-get install libxml2-dev php-zip php-dom php-xmlwriter php-xmlreader php-gd php-curl php-mbstring -y debconf-set-selections <<< "mariadb-server-5.5 mysql-server/root_password password $DBPASSWD" debconf-set-selections <<< "mariadb-server-5.5 mysql-server/root_password_again password $DBPASSWD" apt-get install mariadb-server php7.0-mysql -y # CONFIGURE APACHE AND PHP7 ########################################## cat >/etc/apache2/conf-available/http2.conf <<EOF Protocols h2 h2c http/1.1 H2Push on H2PushPriority * after H2PushPriority text/css before H2PushPriority image/jpeg after 32 H2PushPriority image/png after 32 H2PushPriority application/javascript interleaved SSLProtocol all -SSLv2 -SSLv3 SSLHonorCipherOrder on SSLCipherSuite 'EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA !RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS' EOF cat >> /etc/apache2/apache2.conf <<EOF <IfModule mod_headers.c> Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains; preload" </IfModule> EOF cat > /etc/php/7.0/mods-available/apcu.ini <<EOF extension=apcu.so apc.enable_cli=0 apc.shm_size=256M apc.ttl=7200 apc.gc_ttl=3600 apc.entries_hint=4096 apc.slam_defense=1 apc.serializer=igbinary EOF cat > /etc/php/7.0/mods-available/opcache.ini <<EOF zend_extension=opcache.so opcache.file_cache=/var/www/nextcloud/.opcache; opcache.fast_shutdown=1 EOF a2enmod http2 a2enconf http2 a2enmod proxy_fcgi setenvif a2enconf php7.0-fpm a2enmod rewrite a2enmod headers a2enmod env a2enmod dir a2enmod mime a2enmod ssl a2ensite default-ssl # INSTALL NEXTCLOUD ########################################## cd /var/www/ wget https://download.nextcloud.com/server/releases/nextcloud-$VER.tar.bz2 -O nextcloud.tar.bz2 tar -xvf nextcloud.tar.bz2 rm nextcloud.tar.bz2 mkdir /var/log/nextcloud mkdir /var/www/nextcloud/.opcache ocpath='/var/www/nextcloud' htuser='www-data' htgroup='www-data' rootuser='root' printf "Creating possible missing Directories\n" mkdir -p $ocpath/data mkdir -p $ocpath/updater printf "chmod Files and Directories\n" find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640 find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750 printf "chown Directories\n" chown -R ${rootuser}:${htgroup} ${ocpath}/ chown -R ${htuser}:${htgroup} ${ocpath}/apps/ chown -R ${htuser}:${htgroup} ${ocpath}/config/ chown -R ${htuser}:${htgroup} ${ocpath}/data/ chown -R ${htuser}:${htgroup} ${ocpath}/themes/ chown -R ${htuser}:${htgroup} ${ocpath}/updater/ chown -R ${htuser}:${htgroup} ${ocpath}/.opcache/ chmod +x ${ocpath}/occ printf "chmod/chown .htaccess\n" if [ -f ${ocpath}/.htaccess ] then chmod 0644 ${ocpath}/.htaccess chown ${rootuser}:${htgroup} ${ocpath}/.htaccess fi if [ -f ${ocpath}/data/.htaccess ] then chmod 0644 ${ocpath}/data/.htaccess chown ${rootuser}:${htgroup} ${ocpath}/data/.htaccess fi cat > /etc/apache2/sites-available/nextcloud.conf <<EOF Alias /nextcloud "/var/www/nextcloud/" CustomLog /var/log/nextcloud/access.log combined ErrorLog /var/log/nextcloud/error.log <Directory /var/www/nextcloud/> Options +FollowSymlinks AllowOverride All <IfModule mod_dav.c> Dav off </IfModule> SetEnv HOME /var/www/nextcloud SetEnv HTTP_HOME /var/www/nextcloud </Directory> EOF a2ensite nextcloud mysql -u root -p$DBPASSWD <<EOF CREATE DATABASE nextcloud; CREATE USER '$DBADMIN'@'localhost' IDENTIFIED BY '$DBPASSWD'; GRANT ALL PRIVILEGES ON nextcloud.* TO $DBADMIN@localhost; EXIT EOF # CONFIGURE NEXTCLOUD ########################################## cd /var/www/nextcloud/ sudo -u www-data php occ maintenance:install --database \ "mysql" --database-name "nextcloud" --database-user "$DBADMIN" --database-pass \ "$DBPASSWD" --admin-user "$ADMINUSER" --admin-pass "$DBPASSWD" sudo -u www-data php occ background:cron sed -i '$s=^.*$= '\''memcache.local'\'' \=> '\''\\OC\\Memcache\\APCu'\'',\n);=' /var/www/nextcloud/config/config.php sed -i "s/post_max_size=.*/post_max_size=$MAX_FILESIZE/" /var/www/nextcloud/.user.ini sed -i "s/post_max_size=.*/upload_max_filesize=$MAX_FILESIZE/" /var/www/nextcloud/.user.ini sed -i "s/post_max_size=.*/post_max_size=$MAX_FILESIZE/" /var/www/nextcloud/.htaccess sed -i "s/post_max_size=.*/upload_max_filesize=$MAX_FILESIZE/" /var/www/nextcloud/.htaccess cat >> /var/www/nextcloud/.htaccess <<EOF <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^/?(.*) https://%{SERVER_NAME}/nextcloud/$1 [R,L] </IfModule> EOF echo "*/15 * * * * php -f /var/www/nextcloud/cron.php" > /tmp/crontab_http crontab -u www-data /tmp/crontab_http rm /tmp/crontab_http cat > /usr/local/bin/nextcloud-domain.sh <<'EOF' #!/bin/bash IFACE=$( ip r | grep "default via" | awk '{ print $5 }' ) IP=$( ip a | grep "global $IFACE" | grep -oP '\d{1,3}(.\d{1,3}){3}' | head -1 ) cd /var/www/nextcloud sudo -u www-data php occ config:system:set trusted_domains 1 --value=$IP EOF mkdir -p /usr/lib/systemd/system cat > /usr/lib/systemd/system/nextcloud-domain.service <<'EOF' [Unit] Description=Register Current IP as Nextcloud trusted domain Requires=network.target After=mysql.service [Service] ExecStart=/bin/bash /usr/local/bin/nextcloud-domain.sh [Install] WantedBy=multi-user.target EOF systemctl enable nextcloud-domain # CLEANUP ########################################## apt-get autoremove -y apt-get clean rm /var/lib/apt/lists/* -r rm $STATE_FILE halt fi # License # # This script is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This script is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this script; if not, write to the # Free Software Foundation, Inc., 59 Temple Place, Suite 330, # Boston, MA 02111-1307 USA
#!/bin/bash # Nextcloud installation on QEMU emulated Raspbian image # Tested with 2017-01-11-raspbian-jessie.img (and lite) # # Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com> # GPL licensed (see end of file) * Use at your own risk! # # Usage: # ./install-nextcloud.sh <IP> # Use the IP of your running QEMU Raspbian image # # Notes: # Set DOWNLOAD=0 if you have already downloaded an image. Rename it to nextcloudpi.img IP=$1 # First argument is the QEMU Raspbian IP address DOWNLOAD=1 # Download the latest image EXTRACT=1 # Extract the image from zip, so start from 0 #IMG=raspbian_latest IMG=raspbian_lite_latest INSTALL_SCRIPT=nextcloud.sh IMGFILE="NextCloudPi_$( date "+%m-%d-%y" ).img-stage0" IMGOUT="NextCloudPi_$( date "+%m-%d-%y" ).img" source library.sh [[ "$DOWNLOAD" == "1" ]] && { wget https://downloads.raspberrypi.org/$IMG -O $IMG.zip || exit; } [[ "$DOWNLOAD" == "1" ]] || [[ "$EXTRACT" == "1" ]] && { unzip $IMG.zip && \ mv *-raspbian-*.img $IMGFILE && \ qemu-img resize $IMGFILE +1G || exit } launch_install_qemu $INSTALL_SCRIPT $IMGFILE $IP || exit pack_image $IMGFILE $IMGOUT # License # # This script is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This script is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this script; if not, write to the # Free Software Foundation, Inc., 59 Temple Place, Suite 330, # Boston, MA 02111-1307 USA
References
https://docs.nextcloud.com/server/11/admin_manual/contents.html
https://www.raspberrypi.org/forums/viewtopic.php?f=36&t=160874
Hey I’m trying to run this locally and I keep getting “invalid certificate.” It seems to be forcing all traffic through 443. Is there any way I can make it so http traffic is allowed? Or maybe I could have valid certs for local traffic somehow? While I’m messing with it I’d rather be able to make sure everything is secure and set up before opening it up to the world and I can get it a domain name.
[EDIT] `nextcloudpi-config` now has an option to disable forcing HTTPS
I like having secure defaults. If you are only going to use it in your local network it is not such a big deal, but make sure to go back to HTTPS one you have your public domain.
In any case, even if you have HTTPS with an untrusted certificate, you can just add an exception on your browser. When you have your domain, follow the instructions for Let’s Encrypt on the “advanced configuration” section to get trusted HTTPS
After running:
I receive this error:
Data directory (/mnt/Store/ncdata) is invalid
Please check that the data directory contains a file “.ocdata” in its root.
I just re-checked it and it works for me. Are you sure that the directory exists? Make sure to modify your fstab to mount your USB hard drive on every boot.
I included the mkdir line in the instructions to make sure that the directory is created if it does not exist (/mnt/Store in your case).
If we do not do this step, it works fine but everything stays on the SD card which is more limited in space.
Write the image again on the SD card, then set up the USB drive mount to /mnt/Store, then copy and paste the instructions again. It should work
Don’t know what happened on the first run. Started from scratch, mounted USB drive, and ran the lines, all good now. Raspi sitting next to the router attached to an old 2TB drive for Nextcloud with the data being rsynced to raid array. Cheers!
Haha I am glad. Another person to own their bits 🙂
I love the simplicity of this for newbie’s. I have very thing working well, except the virtual host. I am unsure as to which file I should be adding the lines to.
need a pointer
Thank you for your feedback
My intention is that this is as easy to setup as possible, so I will simplify this for the next release, expected to come out tomorrow
If you do not want to start from zero again, paste this on the command line
There is information about virtual hosts here
https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts
https://httpd.apache.org/docs/2.4/vhosts/examples.html
Hi Nachoparker,
I tried the method you described above for transferring the nextcloud data directory to an external USB drive, but there is still a problem, here is the listing of my try. Note that my nextcloud data directory is in /var/nextcloud/data.
Any suggestions? Note that my USB drive is mounted at /mnt/nextcloud/…
Thanks
you are using /var/nextcloud. If you used my image you should be using /var/www/nextcloud. You have to be on the nextcloud installation folder for this line to work
I have not installed nextcloud from your distribution, so you don’t have to answer. In any case my nextcloud works perfectly well as long as the data directory is on the sd card. It sits at /var/nextcloud/data on the sd card. The problem is how to tell nextcloud that the data directory should now be at /mnt/nextcloud/data which sits on an external USB drive… Thanks
Ok, I see
Then it should be just a matter of doing
another way of doing the same thing would be to edit `/var/nextcloud/config/config.php` and changing the line of `datadirectory`
Thanks for your help. Alas I had already done it both ways exactly as you describe. I think the problem is that the config.php file on my installation sits at /var/www/html/nextcloud/config, not in /var/nextcloud.
As I said everything works fine if all is on the sd card, specifically data in /var/nextcloud/data and the config.php file in /var/www/html/nextcloud/config, again on the sd card. The reason the data directory was moved to /var/nextcloud comes from a suggestion that this is more secure… Here is theexplanation and the URL follows
Secure the Nextcloud Data Directory
It is highly recommended to make Nextcloud more secure by moving the “data” directory to a secure location. Let’s move it to /var/owncloud/data. That will prevent any unauthorized users from accidentally gaining access through the web browser.
Move the data directory:
$ sudo mkdir -p /var/nextcloud
$ sudo mv -v /var/www/html/nextcloud/data /var/nextcloud/data
Configure the new data location into Nextcloud. Using vi or another editor of your choice, edit the configuration file. Make a backup copy first, just in case there is a mistake with the edit:
$ cd /var/www/html/nextcloud/config
$ sudo cp -p config.php config.php.org
$ sudo vi config.php
Change this line:
‘datadirectory’ => ‘/var/www/html/nextcloud/data’,
to this:
‘datadirectory’ => ‘/var/nextcloud/data’,
Be careful not to delete the comma at the end of the line. Save the file and exit the editor.
http://unixetc.co.uk/2016/11/20/simple-nextcloud-installation-on-raspberry-pi/
Many thanks
Very nice! Thanks for the work! One question, in what file would I add the
to redirect?
See the answer to lstehr question above.
I am uploading the new version right now anyway (2-18-17), so if you copy the new one to the SD card you won’t have to do that.
In the new version, you access nextcloud by typing the IP or URL in the browser, do not need to specify `https://`, nor include `/nextcloud`
Some of us do not use Linux i our PC…
Is posible to get an image compatible with a program to burn it in the SD throught Windows?
May be with Rufus (https://rufus.akeo.ie/) or with Win32diskimager (http://sourceforge.net/projects/win32diskimager)…
The image is built to be run on the Raspberry Pi, so you can copy it from windows or linux, it does not matter.
I do not use Windows myself, so I cannot recommend you a solution. Maybe another reader can, or maybe Google can help you 😉
EDIT: added etcher as a recommendation to the post
I used https://etcher.io/ on MacOS. It also has a windows version.
thanks for the suggestion. Actually I ended up including etcher in the post instructions time ago 😉
First, thanks a lot for publishing this great piece of work!
I used to set up owncloud myself on a raspberry pi, but it was always hard and time-consuming to set up and maintain. Now I consider using your nextcloud image. I have one question:
How will updating work? In particular, how to keep nextcloud up to date? Will it update with the usual apt-get upgrade?
Hello, you are very welcome 🙂
Well, if you look at the installation code I basically take the latest files from Nextcloud, so the installation is manual.
As per the official docs,
https://docs.nextcloud.com/server/11/admin_manual/maintenance/upgrade.html
There are two options
1) “Updater” app, which is a Nextcloud App. I have not tried this yet but I will try it first thing when NC 12 comes out. I will let you guys know how it goes if you follow the blog.
2) Manual upgrade, using
3) I will continue releasing images, so when NC 12 comes out I will release another ready to copy image. If your data folder and database are on an external USB drive that could be relatively easy(or not).
There is no raspbian package for Nextcloud that you can `apt-get install` as far as I know.
Nextcloud’s weakest point is probably upgrading. Not an easy process for sure.
I hope this all makes sense.
Thanks for the swift clarification! Yes, this all makes sense. If the updater app works as expected, it will be great improvement over previous (owncloud) versions. Let’s hope for the best 😉
Again: thanks for sharing!
Update:
a new minor release came out. In my first test using the updater app, there are a couple things to adjust for this to work out of the box.
I will get them fixed for the upcoming release
🙂
Update: it works on the latest release
Thank you!!!!!!!!!!!!!!!
The easiest tutorial for installing nextcloud on raspberrypi using https in the net.
And (a little detail) it works!
Hello! I am a total noob at all this stuff. I used your image and for the most part it is OK. I can’t seem to change the max file upload and download size. How do I do that? Thanks!
[EDIT: `nextcloudpi-config` can now configure this with the `nc-limits` option
in the files `/var/www/nextcloud/.user.ini` and `/var/www/nextcloud/.htaccess`
you can use the following piece of code. Paste in the terminal
I have not tested more than 2GB
Thanks! That is great! I will try it tonight!
Hmmmm. I must be doing something wrong. Still not allowed to change it in next cloud and it is stuck at 1GB.
I will make this easier in the next release
Thank you for your feedback
Thanks so much for the help! Totally awesome!
Ok, I spotted the problem. There was a typo in my build scripts that I even copy-pasted to you without noticing. The right command is
Any way, I am currently including this in `nextcloudpi-config` for the next release. It will be easier that way for everyone
Also I can not seem to get Nextcloud to write to my external storage?
Thanks!
did you set up fstab to mount your external storage?
did you run the commands I posted with the right path?
Yes…I did both those things. But when I enter your commands it seems to make that dir on the micro SD card. The drive is auto mounting. but I am not super clear on what steps to check to force it to use the the drive on sda2. Thanks so much!
what is the output of
Here is what it says:
Okay, I can see that your drive is mounted at `/home/pi/RAID1`
Suppose you want to use the folder `ncdata` inside your hard drive. This folder does not exist yet. Paste the following
Then, your private cloud data will be in the `ncdata` folder inside your external drive.
I will also make this easier in the next release
I’ve done it the other way around I installed the image without fail2ban and it worked for me. Trying to setup fail2ban but I’m missing something and not sure what I’m doing wrong so I’ll wait for this new image to save me the headaches.
Great work by the way. 🙂
Does this really work on either a RPi2 or RPi3? I thought that they would need different kernels.
Well… it does… 😉
Very nicely done. And quite fast, too. I wonder, if I could just replace my old setup with this one. However, my current installation is setup against LDAP and also hosts its data and database on a different server. I think, I should be fine by just copying over the config.php.
Again, great piece of work!
I want to use this for my Pi zero W that came yesterday. After writing the image to the SD card, putting a ssh.txt file to the root of the SD card in order for ssh access and after mounting the written SD card and altering /etc/network/interfaces before booting up the pi so that it uses the correct wlan connections and settings i cannot get a ssh connection to the pi. i also do not see it when using a dhcp scanner. does this image work on the pi zero w? the process of ssh.txt and interface file editing does work with the original image of rasbpian.
Hello,
I have not tested this with a Raspberry Pi Zero or an original Raspberry Pi, but it should work. It will be quite slow though. I was running Owncloud on my RPi B before RPi 2 came out and it was usable… but very slow. The zero has a bit more power.
I will test it on zero when I have time. Also any feedback is welcome.
To answer to your questions… the procedure for activating SSH with the ssh.txt file should work (see https://ownyourbits.com/2017/02/06/raspbian-on-qemu-with-network-access/ ).
From the top of my head, in order to get network access you can edit `/etc/dhcpcd.conf`, and include something like this
It should come up as `192.168.0.8`. I am writing this without testing it, just a pointer 🙂
I will try this, thanks! Will report back if it works. I did not think of altering the dhcpd.conf but instead changed the entries in the /etc/network/interfaces file. Maybe that is why i do not get a connection (and this would explain the non working ssh also)
So. your image does boot up on my pi zero w, but it won’t bring up wlan0. I guess there is a driver problem. Is your image based on Debian 9 stretch instead of the current stable branch? I booted up Debian 8 jessie on my zero w and wlan worked without problems, but as soon as i upgraded to stretch testing branch, the wlan also broke there. So I guess it is not a problem with your image in particular, but with Debian 9 stretch branch as for now. As the wlan chip on the zero w an the rpi 3 B are the same, the problem should occur on the rpi 3 also though. Anyone can confirm that or can anyone provide a solution?
Debian 8 based, a release from Feb (about to release an update though)
I have not had the opportunity to get my hands on a zero w yet, but what you say makes sense: same chip, so should work just the same.
What is the output of `ip link` and `iw dev wlan0 info` and `ethtool -i wlan0`?
(need to sudo apt-get ethtool)
Fixed it! Copied the contents of /firmware/bcm…. directoy of a backup of jessie to the directory in stretch and overwrote the files there. now wlan works again. so this is a thing if one upgrades to stretch. Next thing to try is to copy these backup files to your image and see if that also fixes wlan in your image for my zero w.
awesome 🙂
let us know
Can’t get your image to work correctly with the zero w. It does not bring up wlan0 at boot, always says “device not found” or “there is no such device”. I guess the wlan-driver is not loaded at all or can’t be loaded. Maybe this has something to do with the kernel in your image? I already installed the firmware for the wifi-chip (same as rpi3) and also copied over existing files in /firmware/brcm to the zero w from an original raspbian 8 image to your image (on the original raspbian image, the zero w works with wifi). still no success. Did you change the kernel in your image?
Btw: These are the drivers that are used for the wlan/BT chip on the rpi3/zero w:
https://packages.debian.org/jessie/kernel/firmware-brcm80211
tried on pi2, that is already the low end in term of speed, just forget the idea of a pi zero
I can tell you that raspbian didn’t enable wifi or bluetooth for Jessie in June. I don’t know about before that. So what you need to do is to go into your /boot and add ssh.
If you have a male to female USB adapter, life might be easier than I had it…
Anyway, that’s just pi0w info – you can enable your wifi and add ssh.
Then, you should be good.
Hello,
I have a single RPI3 that I use as a multimedia center with OSMC, and would like to have Nextcloud on it too. Do you think you will do in the future an image based on OSMC instead of Raspbian lite, or do you have some pointers on how can I do it myself?
Thanks!
I do not think I will create an image based on OMSC, but I do publish the code for building and configuring Nextcloud. If you follow the instructions above, you can install NexCloud on you any Raspbian based image!
Why not Nginx ? It seems that Nginx , especially for small device’s like the PI is more suited.
I’s searching all over the net to find a good tutorial “how to:
raspbian lite
mariadb
Nginx
Letsencrypt
php7
and so on,,, Your write up is very close, but lack’s Nginx
Would love to see the “perfect” tutorial for a nextcloud installation that can be used live with a hostname for example https://nextcloud.mydomain.com
Well, nginx really shines in high load high concurrency situations. In this case you will not see a difference.
I chose apache because it is what I was already using, and because it had easier support for HTTP2 at the time. If you really want to use nginx, just follow the rest of the building script. I share all the code.
In any case, I have many plans for this blog. I already am starting to build some dockers that I plan to use on RPi. Nginx included. I want to experiment with lighttpd to see if I can make it work with Nextcloud, if you pull the container you will see that it is only 67.8 MB, so about a 10 MB increment from minidebian!
Also, Let’s Encrypt is the next thing I am going to include in nextcloudpi-config
Stay tuned!
https://ownyourbits.com/2017/02/19/creating-a-minimal-debian-container-for-docker/
Hi men!
Great guide and well scripted.
I have a question about the HTTP2 mod on the latest raspbian Pi3. When I try to install the HTTP2 module on the lastest apache from the default disto I get the following error message:
sudo a2enmod http2
ERROR: Module http2 does not exist!
How did you solve this problem?
Cheers!
Thanks, awesome work!
I came across your site by accident, I was looking for something to lets say pre-configure an image like Raspbian or whatever. All this so I would be able any time to replicate my current setup just in case something goes wrong.
I’ve look at Nextcloud before, among numerous other possible solutions, such that I could access my PI from anywhere and show off photos of my little girl on whatever system. Like you I’ve got myself a domain name from no-ip.com and my router provides an auto update feature for noip, easy. After a zillion tries, I found setting for my monitor that works fine so I burn the image from my WIN 10 PC and replace the config.txt file with my version. Unfortunately for me, I decided to use the BTRFS file system for my 5T USB drive and I intend to get a few more. Anyway, all this to say I’m beginning to have memory problems and I want to setup a quasi fail safe system with redundancy, security and the works. At minimum, 2 PI3 in 2 distinct location and 2 large USB drive (BTRFS) each. Currently I’m setup to boot from a micro-SD card but the root file system is on a USB flash drive (EXT4). I want to be able to rebuild any part of the system as easily as possible.
Your image file will definitely bring me very close to what I want. I see you provide indications and or snippets for many different options or solutions. For example with LetsEncrypt, I’ll use that one for sure. Just to give another example, I don’t want any of my users to be login all day long idle most of the time so I want to shut them down after some period. It’s not very complicated to do but every time you burn an image you have to start over from scratch. It’s prone to error, it’s very likely you’ll forget this or that and I’m sure you see me coming.
Does your image provide and or would be easily adapted to self update as much as possible? I mean security wise at minimum? I’d like your advise also on how you would proceed to create a snapshot of the system such that I could (relatively) easily recover from some device failure, be it the PI itself, the card or the USB drives. Yes, it’s possible I’ll never use a micro-SD again and I’ll also go all the way with the BTRFS.
Thanks again, I’m burning the image as we speak…
Yves
well, thanks!
I am busy right now, so I’ll answer in detail tomorrow ( it’s late here )
Just wanted to say that 10 minutes ago I released a new image with some improvements. Burn that one instead 😉
To late !… It’s very early here 2:11AM
Thanks,
I’m glad I tried it and it work fined until I used this code to use :
I have install letsencrypt certs and dnsmasq as explained above and all seems to work fine, except that the nc data directory doesn’t work now.
Any idea why?
I tried again one line at a time and here is the result:
After using the full img and using raspi-config to get a desktop after installing lightdm. There is no possibility to log in with the user pi. Wether you’ve changed the passwd or not
Your issue is a Raspbian Lite issue, so I cannot help you right now. When I have time I will include the steps to get a desktop environment, but as of now that is out of scope.
I suggest you look for the correct procedure to install and start a desktop environment in Raspbian Lite, as it ships without one.
I’d like to add some observation and comments if I may, hopefully constructive.
Yesterday, I burn the full image using win32diskimager, booted up the new image and then ran raspi-config to setup a few things, password, etc.
All of this directly from PI but through SSH. When I came to the nextcloudpi-config part above (usage) the only choice I add where dns-masq and no-ip scripts. Why not the same as we see above?
I notice you practically always refer to QEMU and if I’m not mistaking this mean one need another machine with some linux distro, right?
Just when I installed the 2-18-17 version you where uploading behind the scene the 3-13-17 version and unless I mist something really big this would mean all of us would have to start over from scratch, yes?
This is one of the reason I was searching for some mean to at minimum be assisted in some way to install and especially configure the packages and or services one need, by this I mean passwords (so your first login is with the proper password), the services I want to run like say ssh +++ setting it properly, everyone agrees, passwords is not a good idea so why not configure it right away for public key or at least having the choice. Maybe, yes password login but setup firewall for ssh over LAN only. One last thing, IMHO I don’t think most people will stay on a SD card file system for very long, a single video would bust most of the available space from the start. Why not have the possibility to set this up before installing nextcloud and even the complete web server for that matter. By this, either use an existing drive or drives, format it if necessary and set it up in fstab. Then go one.
You obviously put a lot of effort into this and I don’t want you to think I don’t appreciate your work. I also know the one size fits all theory doesn’t work either but I recall some 40 years back when I installed my Redhat distribution on my my super duper Intel 386 with 256K + 256K ext of memory. All of these thing I speak above (almost) where part of the installation process, so why not have the same or similar for the PI. I almost forgot, that included setting locale, time zone, keyboard and many other stuff before your first login.
I’m curious as well if it would be possible to “UPGRADE” instead of starting over each time you produce a new version? I know, much more work, just some thought.
Thanks a million,
Yves
PS. I don’t see a donation button anywhere here. Ounce I’m all setup and running I would certainly give something. I would go as far as proposing my help for translating stuff in French if it’s any help for others here.
Hello Yves,
First, thank you for your encouraging words and feedback.
You wrote about many things! so I’ll try to answer to things one by one.
First, this is an ‘in progress’ project.
It is already usable but I am not done yet, so there are things that might change over time. Feedback that people like you provide is really valuable for me to realize what is more important for people.
The first reason I started to do this is that for the third time I want to upgrade from owncloud and it is such a pain that I decided I could do it in an automated way and share the result.
Many people would use this but lack the knowledge or time to do it. NC is a great product but it needs an underlying system (such as Raspbian). I figured I could help spread it this way.
I am kind of planning things as I go, and seeing what people’s response is. For instance, I realised that many people struggle with setting things up in Linux, and that is why I came up with `nextcloudpi-config`
With this I mean to say (again) that this is still in a maturing process and that is why the old release did not contain everything in `nextcloudpi-config`.
I do plan now to work on figuring out some easy way to upgrade the system so people’s clouds get the latest security updates. As for NextCloud, the latest release was fixed to allow for upgrading using the `updater` app from NC.
I still do not know how I will do it exactly, but I have some ideas.
The next things I have in mind are
– auto-upgrade for security
– let’s encrypt in nextcloudpi-config
– automount USB drives
When that is working I do not know if I will continue adding things or not. (suggestions welcome). This means that until then, things can change (improve) quite a bit from release to release. In any case, you do not need to start from scratch to get the latest thing, as you can use the `installer.sh` method to add my new things to your working image on a running RPi.
I do not know if it makes sense. For example, imagine you are using the latest image, and then I come up with Let’s Encrypt and add it to my next release. You can always just add it to your working image without starting from zero by updating my git repo and running `./installer.sh letsencrypt.sh 192.168.0.130` (assuming that is your RPi IP).
I’ll say that again because I want it to be clear for everyone.
People that already are running NextCloudPi can just use installer.sh and keep adding the latest things to their running setup. There is no need to start over 🙂
https://ownyourbits.com/2017/03/05/generic-software-installer-for-raspbian/
You mention you had some problems moving the data folder. A bunch of people have come to me asking for help with this. Get the latest release. You can configure it from nextcloudpi-config. I have tested it in all cases I could think of, but of course if someone finds something just tell me.
I do ask everyone to be patient. This all takes a lot of my time and I do my best to listen to what you say, but there is only so much time I can dedicate to this. I will get there, but not immediately.
Talking about a data redundancy system I have a basic thing set up myself using raspberry pi and mirror USB drives. It is very basic, but I want to post about this at some point. I’ll make a post about this using rsync and brtfs, maybe write some little util. Again, when I am done wit Nextcloudpi
QEMU is a virtual machine where I run Raspbian. I use it for testing and for building images (see my Raspbian on QEMU post). You do not need it for using Nextcloudpi on a Rasberry Pi.
https://ownyourbits.com/2017/02/06/raspbian-on-qemu-with-network-access/
I am really flattered about your offer to help and donate. I do not accept donations because I just write this blog to spread what I like and what I consider good for people from the field of technology, like owning and controlling your own private data. Just that. Many thanks anyway!!!
Nacho
Thanks for the image.. really useful
Hi,
I would add a step in your installation instructions to first unmount the disk, like this: sudo diskutil unmount /dev/sdx
Otherwise you will receive a resource busy error message.
Hi,
I’m trying to connect an external USB drive to store my data. I have mounted the drive (ext4) under /mnt/nextcloud. Then I have changed my config. php file to point the datadirectory to that location.
For /mnt/nextcloud I have changed the owner to www:data recursively. I have also changed the permissions recursively to 700.
In the NextCloud UI, I’m getting a ‘Data directory (/mnt/nextcloud) not writable’ error message. Just to test, I have given the /mnt/nextcloud dir a 777 permission, but the error message is always there (note I restart Apache each time, just in case).
I have no idea what could be wrong here. Can you help me with this?
Hi,
If you are using NextCloudPi, just type
and you can change your data dir location in one of the options.
If you want to do it manually, have a look at my script nc-datadir
https://github.com/nachoparker/nextcloud-raspbian-generator/blob/master/nc-datadir.sh
I am using this amazing piece of software on a RPi3. I observe high ongoin cpu load (>3) generated by php-fpm. What do I need to change in the configuration to lower the cpu load and have a more responsive setup?
can you explain what you mean by high CPU load?
If I use it non-stop changing dirs, loading content and such I cannot get php-fpm over 40% CPU in brief spikes. I can only saturate the system to 1.6 load average like this.
During an upload, the apache process can take up to 50% of the CPU in my testing. Up to 70% during a download
I consider all this normal. NC is pretty responsive to me.
What is your setup? have you changed the data directory or made any other changes? what class is your SD card?
Thanks for your Raspberry Pi image for Nextcloud. I really hope the next version Raspberry Pi supports USB 3. Currently, Raspberry Pi 3 only has USB 2, it makes me concern the I/O speed when installing Nextcloud on Raspberry Pi.
In my experience performance is pretty decent for private use. If you have a spare SD card just try it! it takes two minutes to have NextCloudPi working 😉
Hi,
Thank you for this image! I am trying to install the nextcloud app passman so i can replace lastpass. It won’t get past, and hangs when creating a new vault. I tried the passman demo and creating a new vault took 2 seconds. Is this a permission problem or something of the kind?, and how do i fix it?
Thanks in advance!
Hello,
I have not tried that App but NextCloudPi is just a normal NextCloud, so it shouldn’t be different from other NextCloud installations.
Do you have any extras installed or custom configurations? Did you activate modsecurity? I recommend to disable it whenever we are installing new apps or if we find something weird.
It comes disabled by default
When uploading anything over 2mb (i think) i get a error; request entity too large displayed in my browser.
I tried;
followed by a reboot but that didn’t fix it. ;/
Hello,
You do not need to use that code anymore. You can configure that in the `nc-limits` section of `nextcloudpi-config`
Try from
In any case, I have successfully uploaded big files, for instance, 500 MB. I have never seen that error before. I do not think it is related to the upload limits. In general you can upload things up to ~700 MB according to my testing.
Again… did you enable modsecurity in `nextcloudpi-config` by any chance? Any configuration? Did you move the data dir to an external USB? how big is your SD card?
Can you copy the exact error message or provide a screenshot?
Yes, I have moved the NC data to /data/ncdata, afterward I changed the limits in the next cloud piecing it. The error happened and then I added the code I pasted above. I also have modsecurity installed. Where can I find the log?
Thank you!!
I just disabled modsecurity and both my problems are gone, i can upload according to the nextcloudpi-config settings and passman works.
Damnit, sorry! Going to read your references on the subject cuz i feel like an idiot.
haha I am glad it works
modsecurity needs more testing as people install Apps, I need to refine the rules gradually and that is why it is marked as experimental.
If anyone runs into an issue like this, it would be awesome that they explain what App they were trying to install or what operation they were trying to perform and failed, and post the contents of `/var/log/apache2/modsec_audit.log`
https://github.com/nachoparker/nextcloud-raspbian-generator/issues
Hi,
I’ve just installed your image and I’m impressed with how it has gone.
I am however having difficulty connecting to my wifi network, which is important to me.
I’m using a new raspi 3 model b with an external self powered usb drive. I have static IP addresses set at my router, and the address for this mac address is 192.168.0.142
Everything works fine until I use nc-wifi when I select ok to choose a network, no networks are found.
My /etc/network/interfaces file looks like this:
and ifconfig wlan section like this:
The wifi was working fine when I tried a plain raspbian image, and the ethernet connection works fine now picking up the static address from the router.
I’m stuck, how do I get the wifi to work?
Colin
edit the supplicant file see
https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md
when you go to `nc-wifi`, hit ‘P’ (for preferences) and in the box “wireless interface” type “wlan0”.
Hit F10 to save, and then ‘R’ to scan
I will automate that step on the next release
Thanks, that’s great
I have connected my USB hard drive but how do I mount it to show up in /media/?
[EDIT: this manual configuration is not necessary anymore, just use `nc-automount` in `nextcloudpi-config`]
you have to set it up in `/etc/fstab` to mount at every boot.
1) write the line in `/etc/fstab`
2) type ‘sudo mount -a’
It should now show up. Look up on google “fstab USB drive debian” and you’ll find tons of info.
I will make this easier on upcoming releases
thanks i appreciate the quick response.
i figured this out and mounted it to `/media` but how do i get around the permissions?
i chmoded the mount dir to 775 and also changed ownership to pi but when i try to chdir or ls `/media` i get a permission denied.
I figured this issue out. if anyone runs into this problem i found this website to be very helpful
https://www.htpcguides.com/properly-mount-usb-storage-raspberry-pi/
the “swapon -s” return
Filename Type Size Used Priority
/dev/sda1 partition 67108860 0 -1
what shoud I put in the “nc-swapfile”? is it /dev/sda1?
Thks
Are you using NextCloudPi? if so, you must have changed it to use a partition as swap.
The default is `/var/swap` and is a swapfile of ~100MB.
In `nc-swapfile`, type something like `/media/USBdrive/swapfile`, not a partition like `/dev/sda1`.
You should have a USB drive connected and mounted to `/media/USBdrive` first
Did every thing to mount USB and chmod 770 but I get still an error moving the data and database directory to USB.
what exactly the permission should be?
moving the data directory only seems to work but still I could not find the directory for the new user that I created on the disk though the files show in web interface. The “admin” user and the files are on the disk.
I have a 2nd pi that is connected to a hard disk. The data partition is NTFS. And here I got in to permission problem. I get “Please change the permissions to 0770 so that the directory cannot be listed by other users.”
I have “UUID=F21841E01841A487 /media/nxtclud ntfs-3g nofail,uid=pi,gid=pi,umask=0770 0 0” in fstab.
it is working now thanks.
i got this error on my firefox but i can go through with ie by clicking on trused.
Your connection is not secure
The owner of XXX.XXX.X.XXX has configured their website improperly. To protect your information from being stolen, Firefox has not connected to this website.
also when i tried connecting the nextcloud windows app and the pi it gives me this error. is it ok to tick trust this certificate anyway?
"Cannot connect securely to XXX.XXX.X.XXX:
The host name did not match any of the valid hosts for this certificate The certificate is self-signed, and untrusted
with Certificate raspberrypi Organization: Unit: Country:
can you explain the error received and possible action i should take? sorry just being paranoid
read the “Advanced configuration” section above and this article for the explanation and the solution.
https://ownyourbits.com/2017/03/17/lets-encrypt-installer-for-apache/
Basically, you can fix it from `sudo nextcloudpi-config`
the tutorial involves me getting a domain in no-ip right? for now i dont have intention on making my server online yet. is there a solution for just local offline?
I am afraid not. Only if a certification authority (CA) verifies that your certificate is valid it can be trusted. That is why it is called third party authentication. You need internet access for the CA to verify that you are who you say you are in the certificate.
In most cases, just accepting the warnings and adding the exceptions works fine. Most software I have seen allows for use of self-signed certificate.
It works anyway, it is just that it warns you about that.
Hello,
is there a chance to implement “spdyn.de” ?
well, I am considering including other DDNS clients, but the priority is very low. Other people have asked for duckdns and freemyip.
I would have to run a poll or something to measure the interest.
🙂
thx 4 the quick request. I have think its only a small quick change in a script. but it looks like its more.no problem.
I also want thanks for your great job. in the moment i let it run on a RPi3. In next time i get the Nextcloudbox and than i put it there. I saw here also a tut how to bind external hdd. If i have problems i think i can ask there.
cYu
Hello,
here some really noobs question
1. I get next time the Nextcloudbox. So i want to install the NextCloudPi on the card.But i want the accounts and data transfer to the hdd.Maybe after a new installation i have all my data back (Useraccounts and Data are not deleted). Have somebody something like a step by step tutorial how to make this ? I saw the post from Marck Buckmann, but i think this is only to store the data on the hdd, not the accounts. If everything work like i want, what i need to do after a fresh install of the SD ?
2. I read to change the passwords. OK. pi/raspberry on the pi and admin/ownyourbits in the browser. Do i need change more passwords somewhere ?
Again, i really happy about your project and the most things are really easy to make.Great great job and support of you.
cYu
i forgot. whats happen with the “externel drive” IN nextcloud ? is that the same like i bind it in the pi?
Here also a good tutorial in german
https://www.canox.net/2016/06/die-eigene-cloud-mit-dem-raspberry-pi-und-nextcloud/
And here how to bind a spdns updater
https://www.canox.net/2016/06/die-eigene-cloud-mit-dem-raspberry-pi-und-nextcloud/#spdyn-client
cYu
You can export news(.opml), contacts(.vcf) and calendar/tasks(.ics) and then re-import them.
I do not think you can export the users though.
You can also change the database password if you want, but you also have to change it in `/var/www/nextcloud/config/config.php`
The external drive allows you to use a HDD that appears as a special folder inside your data directory.
The difference with nc-data is that you move all of your data directory to the USB drive
Hello,
i think that is what i mean
“The difference with nc-data is that you move all of your data directory to the USB drive”
After a new installation of th Card i only need to bind the folder on the hdd and everything is like before.Or?
cYu
bind the folder
re-create users
import contacts
import calendar/tasks ( they go together )
Thanks a million for providing us with NextCloudPi. It’s great work, and we very much appreciate your effort. Thank you!
Hello! That you for putting this together. Although I am having some issues with the Let’s Encrypt piece, I HAVE had the overall server up and running for about a month, now, and there haven’t been any issues. Keep up the good work!
so what specific issues are you having? working like a charm for me so far (in the let’s encrypt post, please)
note that from, 03-31-2017 there is a remote update system, so maybe it would be worth for you to use a recent image in order to get updates and fixes easily.
See
https://ownyourbits.com/2017/03/31/nextcloudpi-gets-remote-updates-logs-to-ram-easy-wifi-and-more/
I am glad you are enjoying it!
🙂
Thanks for this ready to go .img (so easy to install nextcloud now since I had problems doing it myself, with community tutorials hehe)
I have problems using an external usb, I tell you what I did:
In Nextcloud I added the external drive “/media/usbstick” and it shows up green and accesible but it says [You don’t have permission to upload or create files here] 🙁
I would like to use it as a usb stick to plug and unplug when I want to get files from there.
Also will be great if it can auto detect when I plug but first part for me is to be able to write or read in it 😀 thank you in advance for any help here.
Automount is the next thing on the roadmap of features
NextCloud from the point of view of your system is the user `www-data`. You need to make sure that `www-data` has permissions to write/read/access that folder
Investigate the options to mount vfat, such as `umask`.
Thank you, I’ve found how to, and learnt about umask and chmod/chown options, if anyone looks for this: I’ve set 755 permissions to the mountpoint folder for the nextcloud user www-data, remember to give it also in the fstab with umask:0002 for the automont.
I havn’t tried to unplug the usb while Nextcloud is active, but will be nice to know if I can plug and unplug as much as I need to while the raspi stills powered on with Nextcloud running and if it won’t break my FS.
For now I’m doing sudo shutdown -h now and then poweroff the raspi for unpluging the usb
Now I’m also trying the encryption module, It works great, it doesn’t secure the filenames.
awesome, good job
for safely unmounting, you would have to `sudo umount /media/USBdrive` (or whatever is the mount point). It will fail if you are using any file at that moment.
what is the encryption module? some NextCloud app?
every thing is working good. But 16GB SDcard on my pi2 gets quickly filled up though I migrated data and database folders to hard-disk. Checked the file system to see where all the card space is gone and there is a 13.5 GB taken by /var/log/. Is that normal?
wow, that is not normal at all.
Did you install any extra software?
Let’s see, what is the output of the following command
`find /var/log | while read f; do du -s $f; done | sort -nr`
It doesn’t let me Reply to your question again so I quote you here.
nachoparker says: what is the encryption module? some NextCloud app?
The moudle (under applications) :
Default encryption module 1.4.1
por Bjoern Schiessle, Clark Tomlinson (Licencia AGPL)
I tested it, works perfect, it is not too secure becouse you can still see the thumbnails created from gallery previews in the thumbnails folder (the community knows and is trying to fix it, for now you have to disable thumbnails)
awesome, I’ll give it a try!
Noob question. I’m new to linux, so I’m new to setting up fstab or auto mounting/ etc. I have the nextcloud Box setup w/ Pi 3. For nextcloudPi, do I need to- 1.) setup nextcloudPi via its SD card– 2.) fstab? or format? or mount? The WD Labs PiDrive? Any pointers or links to a step by step tutorial would be greatly appreciated. Please & Thanks You.
Actually my recommendation is that you wait for two days until I finish the automount feature. I keep answering this common question, so I think it is better to make it easier for users. I am almost done.
You can also browse the comments above.
Now
1) setup stuff through nextcloudpi-config
2) format to ext4 the HDD
3) set it up in `fstab`
In two days (hopefully)
1) setup through nextcloudpi-config, including activating automount feature
(Whining voice) “2 days is soooo long! I want one now!!” Just kidding, you put a lot of hard work in. For this I thank you. Maybe I can use that quemu program to learn w/o physically touching the Pi3. Or just do it to learn in “now” steps & erase SD card & format PiDrive w/ my pc in 2 days to test your new version.
If this goes well, I can probably convince a few other people to do the same setup & finally dump Dropbox/google services/iCloud sync. (So, excited to do this!)
awesome!!
I do everything on the QEMU virtual machine, but I warn you that it is pretty slow.
It is great though to try things out, break stuff and learn.
For mounting an external USB though, you are probably better learning on a real system with USB 😉
You can just erase the SD card over and over if you mess up. Just be carefull to `sudo halt` and unplug before removing the SD card, or it might get damaged.
Good luck with that!
My router supports DDNS with no -ip. Should I use that? Or is that complicating things & might mess up the lets encrypt step for SSL?
no, that should be fine
Just a heads up. Today I couldn’t get my HDMI to work on first boot. So I tried to log in via SSH on my local lan, & was able to via default raspberry user credentials. I only use it to shut down (Sudo halt) the pie, until I can get a new hdmi monitor. Am I supposed to be able to log in ssh to pi on 1st boot?
The first time you copy the image to an SD card SSH is disabled by default.
If you do not have a monitor and need to connect headless (through SSH) the method is to place an (empty) file called `ssh` in the boot partition (the first one) of the SD card.
This will enable SSH on your next boot.
I use that trick to access my QEMU images. See here
https://github.com/nachoparker/qemu-raspbian-network/blob/master/qemu-pi.sh#L108
Interesting….using the version from- (3-13-2017), I was able to ssh in from a computer on my local LAN, on fresh first, first time putting an sd card in Pi3. I copied img using etcher, not sure if that matters. Also, I’m new to Linux, so I wasn’t sure if that is a default setting or not.
Also, I plugged in a different HDMI monitor & now that’s how I’m going to do setup. I just wanted to pass along that info about ssh. I can send pics if you’d like.
I am on vacation now so I have limited internet access.
Thank you very much for the feedback and offering. That was a mistake in the construction of the image. It is fixed now for people that download the new image.
Enjoy that cloud! It seems that you got it working
🙂
Upgrading to 11.0.3 fails with file permission problems: https://github.com/nextcloud/server/issues/4509
What is the workaround?
[EDIT: I recommend to use `nc-backup` before trying this. If it fails, just go back with `nc-restore`]
I know, but that is not the issue with NextCloudPi because I ‘fixed’ the permissions. I created that issue to report it to them. (look, it is reported by nachoparker 🙂 )
I fixed the permissions so you could upgrade from 11.0.1 to 11.0.2.
BUT do not try to upgrade to 11.0.3 in any case, because when I tested it I discovered that it fails.
I also reported this other bug to the NextCloud developers, as you can see here
https://github.com/nextcloud/server/issues/4505
If you already did and NC is broken for you, unfortunately, you will have to manually restore your backup (it is performed automatically during the upgrade process).
Today I uploaded a fresh version of NextCloudPi with NC 11.0.3, but you would have to start over (recopy your files, re-import your calendars, etc)
Sadly, it seems that the updater is not very stable. At this point I do not recommend it.
The upgrade from 11.0.2 to 11.0.3 fails prior to the actual upgrade because of the permissions check. So NC is fine, it’s just still on 11.0.2. At this stage the only way out as I see it is to manually set the permissions back to sane values, which I do not see as a workaround in any of the pages I read. I’ll wait a little longer until the NC people sort it out. But, removing the hardening of permissions in the documentation isn’t going to solve the problem for those already stuck with the hardened permissions…
interesting, I just tested this on a fresh NextCloudPi image and permissions are ok. Actually, I reported it
https://github.com/nextcloud/server/issues/4509
and they told me that they just dropped the “hardened” permissions recommendation. Makes sense: it never worked.
https://github.com/nextcloud/documentation/pull/431
Like I said… either copy your files/calendars/whatever and install a fresh NCP 11.0.3 or do the update manually
How come i setup my pi, got wifi to work, everything works great, but i cannot get acces to the nextcloud part of it.
It tells me its unsecure in chrome, though letsencrypt is setup properly.
http error 500. 🙁
I try not to respond to issues here. Please, open an issue report in https://github.com/nachoparker/nextcloud-raspbian-generator/issues
You can still access your cloud by “accepting a security exception” (it’s an option at the bottom of the error page), but if let’s encrypt went well that should not happen.
Please, post all steps prior to the error, and the output of `nextcloudpi-config` > `letsencrypt`
I found this link to be a very good tutorial on setting up your wifi on a raspberry pi:
http://weworkweplay.com/play/automatically-connect-a-raspberry-pi-to-a-wifi-network/
Thanks for sharing. Once you had your dongle recognized by the raspberry pi… Did you try connecting through `nc-wifi` in `nextcloudpi-config`?
That is the recommended method in NextCloudPi and it should be easier. If you had a problem with that please let me know
I initially tried the nextcloudpi-config option to configure my wifi, but it would never accept my passphrase. The issue was that I needed to download and install the linux driver for my dongle, before it wanted to play right. Since I was at the command line, I just stayed there to configure the wireless dongle and the only problem I had after installing the driver is that the dongle would not be recognized after I rebooted my Pi. After some research I found that using the lsmod command along with modprobe, I was able to wake up my wireless dongle.
The challenge was to figure out how to issue this command at start up. I just created a .sh script with
modprobe 8188CUS
made it executable and placed this script in my etc/init.d directory and I was good to go.
I see, good job
As long as it works for you that’s fine. If you want to learn further, a more standard approach is to configure the wifi module to start upon boot in `/etc/modules.d` or `/etc/modprobe.d`, depending on the distro .
Then nextcloudpi-config or what you did wpa supplicant script on boot will make it connect on boot
🙂
Maybe i could PM you the adress for the box, i would gladly give you telnet-access.
Actually it’s open right now, just give me a way of giving you the adress in private.
The fact is that i cannot access it. It just gives me an blank page.
Everything has been an success, though i’ve yet to try an usb-drive to the box, thats the next step.
I’ve successfully managed to setup this on LAN cable, but its my first try on wifi, and it cannot work.
I setup letsencrypt after i connected and had a working wifi connection.
I am on vacation now so I have limited internet access
Read the website or other tutorials, you are almost there!
I’ve tried to set this up with my raspberry pi 3.
The problem is that apache is reaaaaaally slow. I can hardly load nextcloud or anything else.
Also, when I reload nextcloud (or anything else), the SSH session gets killed.
Any ideas on this? I didn’t expect it to be so slow.
If I want to start from scratch? I was just testing some things before. Are the steps to re-image my SD card & place back in Pi, then use fstab to mount my USB HDD? Then setup extras via nextcloudpi-config ?
Thanks for your hard work NachoParker!!
Yeah, just copy the image again and setup fstab, then reconfigure with nextxloudpi-config.
after vacation I will include automount so the fstab step can be automatic
Ok, I managed to fix the slow apache / ssh kill problem (it was the power supply).
But I now have another big problem.
I want the nextcloud data to be on my Synology NAS. I therefore mounted the share via CIFS in /etc/fstab, and it gets mounted without any error and nextcloud can read the data folder, BUT it cannot write or delete anything in there.
So for example if I want to create a folder in Nextcloud I just get an error.
It must be a permission problem, but I don’t know how to fix it.
This is inside of /etc/fstab:
//192.168.X.X/abc/xyz /mnt/xyz/ cifs defaults,owner,noauto,nofail,user=##,passwd=##,uid=33,gid=33,rw,noperm,x-systemd.automount,x-systemd.requires=network-online.target 0 0
I set uid=33 and gid=33 so the files inside of the mounted folder are owned by www-data (so Apache can read it) but this “rw” for read/write doesn’t work. I also tried to set the permissions to 770 with “dir_mode” and “file_mode” but this didn’t change anything until I set ‘nounix’ aswell (then the files/folders are really 770), but then ls -l only shows some ???? at the mountpoint.
NFS is not an option as my NAS uses different users than the PI for the http folders.
Because of this, nextcloud doesn’t even write anything in the log (as it somehow doesn’t have the permission to write in it, strangely).
Is it maybe an Apache problem? That it doesn’t grant the access?
I would be so glad if anyone could help me solve my problem! Thank you so much!
And thanks a lot for the image, nachoparker!
I am on vacation now so I have limited internet access.
Try to follow my post on samba or of tutorials.
Make sure the folder has write permissions for 33 before mounting. Then mount with correct permissions and user 33. Set up the server with nextcoudpi-config
Hi, Great overall experience so thanks but I get this issue when trying to setup letsencrypt
[EDIT: moved here https://github.com/nachoparker/nextcloud-raspbian-generator/issues/9 ]
See answer here.
https://github.com/nachoparker/nextcloud-raspbian-generator/issues/9
Read post carefully about letsencrypt also, you need to input correct domain
After some effort I finally was able to get my Edimax wireless dongle to get recognized. I then needed to do some research on how to get it recognized after each reboot. I needed to do a modprobe command to get my dongle to wake up. So I created shell script and placed it in my init.d directory and everything is okay with wifi.
When I first launch the browser on a Windows PC using my ip addresss/nextcloud I get this error message:
“You are accessing the server from an untrusted domain.
Please contact your administrator. If you are an administrator of this instance, configure the “trusted_domains” setting in config/config.php. An example configuration is provided in config/config.sample.php.
Depending on your configuration, as an administrator you might also be able to use the button below to trust this domain.”
Do I need to run each option in the nextcloud config option before I can expect to have a functional Cloud service on my Raspberry Pi? As things stand now I can’t login to my nextcloud server due to the error above. I know this is supposed to make things easier on inexperienced users which I would include myself, but I’m stuck in the mud right now and don’t know how to get out.
I am on vacation right now. whatever you write on the browser must be in config.php trusted domains section.
Nextcloudpi puts your ip automatically or it should, you can check online how to edit that file and add the IP or URL
Can’t help more, I am on vacation, writing from my phone
You are almost there
If I am not detecting your IP correctly I would be interested to know why. Please open an issue on github with relevant info. at least output of
ip address
Anybody??
wil, I responded to you yesterday, see my answer above or click the link
https://ownyourbits.com/2017/02/13/nextcloud-ready-raspberry-pi-image/#comment-425
nachoparker thanks for your response while on vacation. I am currently looking into OpenMediaVault as another option with my raspberry pi.
nachoparker says:
“Like I said… either copy your files/calendars/whatever and install a fresh NCP 11.0.3 or do the update manually”
That fix isn’t acceptable since I’ve already made many non-NC configurations, and rebuilding an entire system just because of some messed-up file permissions is not a good advice.
On that note, I will move to a ubuntu/snap build of NC since that way a cock-up in setting up NC won’t result in rebuilding the entire system.
Hope you will be satisfied with the changeover. However, do not forget that the GNU license is clear:
“#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#”
For me… Thanks NachoParker! Excelent work.
Thank you for your words 🙂
Like I said, I fixe the permissions for the upgrade from 11.0.1 to 11.0.2.
When I tested the upgrade to 11.0.3 I did not have an issue with permissions (I had a different issue, which I reported to NC), but I would be interested in seeing what happened to your NCP instance.
Would you kindly open an issue on the github for the project? post details of configuration, the error message, etc
https://github.com/nachoparker/nextcloud-raspbian-generator/issues
Also, if it is a problem with permissions, you can just fix the permissions yourself so the updater does not complain, but like I said, I do not recommend using the updater because NextCloud still has to work in improving it.
In any case, it would be great to get feedback of any problem that I did not encounter, and in case it needs to be dealt with, fix it
thank you
Sorry for this stupid question but i know nothing about Linux.
I installed this fantastic piece of software and everything works fine – but.
I’m used to use owncloud for synchronizing contacts to windows phones. Now i want to switch to nextcloud. Therefore i need to download the certificate to install it on the phone. I did this let’s encrypt config but cannot find the certificate file which i assume is called something like .pem
Please…
You don’t need to install any self signed certificate. Letsencrypt signs the certificate for you and your phone can verify it without installing anything
Please read the post about letsencrypt carefully for a longer explanation
Love the work you’ve done and really appreciate it. I took the time to use your image when I had to migrate to another DDNS provider after I had to get a new router (no DD-WRT so I couldn’t do a custom one). Anyway, I’ve got an A- on the Mozilla Observatory and a B on Security Headers. Both mention Content-Security-Policy containing ‘unsafe-eval’ which should be removed. My question is, where did you set this policy? I set it from scratch when I followed another tutorial on my previous install, but rather than search for it, I’d figure I’d ask you first. There is also the Public-Key-Pins and Referrer-Policy. I feel like only the Referrer Policy can be set, but not the other, since I’m using a DDNS, correct?
I am on vacation for another 10 days,so I will get back to you when I have access to my computer
Thanks!
Just wondering if you’ve been able to get a chance to look at these issues?
Hi
If I remember correcty, CSP is determined by the Nextcloud server code.
Same thing with the referer policy, it is set to ‘never’ in the server html
I don’t see the relationship with DDNS
I just found NextcloudPI and am interested in using it to set up a Nextcloud instance for my home.
I am confused and want to make sure I get this right.
I am trying to create an image (using Raspbian Lite?) to run Nextcloud on a RPi3. I already have an external hard disk. In reading your instructions, I am confused about the Qemu stuff. Since I am running directly on a RPi, do I need Qemu at all? I think not.
Do I just create a bootable image of your nextcloudpi image file and boot on a RPi? Once I’ve done that, is Nextcloud installed in running, or do I need to use the install script to install Nextcloud? I think I just need to run nextcloudpi-config to setup everything, correct?
Thanks for all your work on this!
You can download the image and copy it to the SD card. Boom working in 3 minutes.
Then, use nextcloudpi-config to configure things like USB hard drive and other extras
If you want to build the image yourself, you can use QEMU for that and the resulting image you can copy it to an SD card. It will have nextcloud working
Or you can install nextcloud on any raspbian with the scripts provided, directly on the rpi
Those are the options
Thanks! I will give the image a try.
This is impressive and works flawlessly right from your image. Just a question and I am not an expert mind you. I read on another site that it is recommended to use nginx on a Raspberry Pi because Apache is so resource demanding. Do you have any opinion on this one way or the other?
Again, thank you for this excellent project
Hi
Thx
So many people asking the same thing haha I should write a post about it.
Basically nginx shines in high concurrency situations… If you are hosting a web with hundreds of connections per second..
For a personal hosting only accessed by you you won’t feel a difference
Apache has many modules, and they can be loaded dynamically, meaning that is easier from apt without compiling to install and manage.
Nginx is only starting to do this and is still not easy to accomplish
If you read my post about NC security
https://ownyourbits.com/2017/03/25/nextcloud-a-security-analysis/
https://ownyourbits.com/2017/03/23/modsecurity-web-application-firewall-for-nextcloud/
I really value the added security of modsecurity for Apache.
Those are my reasons, but of course it will depend on each use case
Look this for more details
http://www.hostingadvice.com/how-to/nginx-vs-apache
sudo nextcloudpi-config
Command not found
Why?
You should first run “sudo raspi-config” and then choose the first option to access to nextcloudpi-config.
If you do not have that command that is because you are not running my image
I created those commands for nextcloudpi
Dear friend, I would like to migrate from apache2 to nginx as my nextcloud server proxy, is there any recommanded processes I can do?
I am not clear on wether you intend to setup a proxy or replace the web server
I guess that any standard guide will help. As for the motivation for Apache, see this answer
https://ownyourbits.com/2017/02/13/nextcloud-ready-raspberry-pi-image/#comment-483
Thx a lot!
Hi nachoparker,
Thank you for this excellent installation method, I’ve been struggling with owncloud for a while.
I’m stuck now at the point of trying to add an external USB storage. I use exFAT file system, so I know I need exfat-utils.
No matter how I mount it, it does not work.
Could you please be more specific on what is “properly configured to automount upon boot”?
I’m aware on the need to use fstab, but I could not make it work so far.
Thank you.
Jose
Hey,
thanks for great work! why not provide an image based on full rasbian?
or….when can I find step by step guide to install your NC over raspbian without QEMU?
I am on vacation so can’t help much but look into the code.
if the IP for your raspi is 192.168.1.10 for example, you can install the LAMP with
`./install-nextcloud.sh 192.168.1.10`
And nextcloud with
`./installer.sh nextcloud.sh 192.168.1.10`
Look for instance in
https://github.com/nachoparker/nextcloud-raspbian-generator/blob/master/batch.sh
If you need more info for example about different user and password from defaults look at post
https://ownyourbits.com/2017/03/05/generic-software-installer-for-raspbian/
Hello,
Thanks for the great work. Everything works out perfectly! I am just left with one more question, is it possible to use a VPN as well / is it recommended?
Thanks
Well, it would be another layer of security, even though the traffic is already encrypted
And would you recommend to enable Server-side encryption in the Nextcloud Encryption settings?
Hello friend,
Thanks for your amazing works.
I currenttly have nextcloud installed on my SD card, and the card’s I/O speed limits to about 10~20MB/S, I have two methods to improve I/O performance for optimizing nextcloud:
1. Using a higher speed SD card for example UHS-3 level(But I read that Raspberr Pi 3 doesn’t support this speed level SD card);
2. Storaging NC’s database and files in an external USB driven hard disk.
Which method above can effectively improve Raspberry Pi 3’s I/O performance? Or both? Or another method?
Thanks!
I’m trying to up the max execution time from 3600 seconds the 7200 seconds to allow for larger files or slower connections. How can I adjust this?
Look at the code
https://github.com/nachoparker/nextcloud-raspbian-generator/blob/master/nextcloud.sh
`# slow transfers will be killed after this time
cat >> /var/www/nextcloud/.user.ini <<< "max_execution_time=$MAXTRANSFERTIME_"`
Hello,
I am currently having the problem, that my Nextcloud config at /var/www/nextcloud/config/config.php is always resetting as soon as I reboot my RPi. This causes the problem, that my domain isn’t in the white list anymore and I have basically no access to my cloud. So I have to edit the file each time my RPi is rebooting.
Do you have any idea how I cloud solve that?
Btw great work!
You are probably editing the trusted domain list directly in config.php
Then, add your trusted domain in position number 3 or greater of the list. Number 1 is overridden on boot to your IP, and number 2 is used by dnsmasq / noip in nextcloudpi-config
Either that, or disable the behavior
`sudo systemctl disable nextcloud-domain`
Hi,
I downloaded the 612 MB Image and put it on the SD Card. Afterwards. I was able to access nextcloud via local IP. Afterwards I issued a new certificate with Letsencrypt. Then I changed the external data on /media/USBdrive/ncdata and saved it in fstab.
I am getting the issue with ocdata but the error attempts only when I redirect to my website when connected in LAN. CA is ok Outside I am not getting so far and receiving fault ” unsecure connection with err_cert_authority_invalid but inside LAN OK. I created ocdata via bank and saved in root =>” /” and changed owner to www-data. READ PERMISSION is granted. All without success. A reinstall is to critical I had in the past issues with Certificate so better no new install. What can be the problem and how can I solve it. Any ideas.? Best regards flipthemouse
Hello,
Do you know how I can remove index.php in the URL bar? I already checked a couple of guides but non worked.
Thanks for your help!
That is a redirection that nextcloud performs. AFAIK the way to change that involves tweaking NC code
Hello!
im pretty new.. so i understood right that i have to do following things:
– Iso -> SD Card
– Input no-ip data
– DDns data
– open Ports
Then i should be rdy to connect from internet?
Yes.
Steps 2 and 3 are the same, noip is a DDNS but you can use other if you want.
You also should set up dnsmasq to update your trusted domains. In the future this won’t be needed
I am having a terrible time getting the NC data stored on a usb stick. I have tried the 2 items in Nexcloudpi-config and also tried to edit the fstab file. I can mount my usb as /media/USBstick, but I get an error when I try to access the web login. It states that the directory does not have proper permissions. I cannot seem to figure this out. Can you post a sample of all steps to setup a usb stick that is sda1 and anything needed to make it mount at boot. Thanks
I am working in automount at the moment. Your problem is that you are using a drive formatted in a non Unix filesystem, such as VFAT or NTFS. I recommend you format to ext4, because that filesystem is aware of file permissions and because the Linux driver has way better performance
[EDIT: automount feature is available https://ownyourbits.com/2017/05/24/nextcloudpi-gets-automount-backups-nextcloud-online-installation-nextcloud-12-and-more/ ]
Hy, ich Follow your instruction to install nextcloud on Pi.
But i have a problem.
My domain isnt trusted and i get an error, to trust it.
Now i have found anyone about Config/config.php to add a trusted domain.
How i must do it and where find i this file ?
Dear NachoParker:
This has been the easiest and best cloud setup I have ever used. I used to have ownCloud setup on my RaspberryPi then I read about ownCloud vs NextCloud goals objectives regarding Open EchoSystem (development transparency). I wanted to make the jump from ownCloud to NextCloud with clean setup and you have amazed me with the simplicity of setup including usage of fail2ban and ddns as well as additions added to your image and creating free SSL cert and ModSecurity bundled…all I can say is WOW!
Thank you so much for your dedicated time to create this and so much for continuing to embrace “Peace of Mind”. Keep up the awesomeness…looking forward to many other bright features.
thank you! That is exactly what I am after… lowering the barrier for people to set this up or upgrade it
Hey,
just installed this nice image on my RPi3 (4GB microSD). Thanks for the nice work :). I added the PiDrive from WDLabs as a ext4 to the system and moved the files with “nextcloudpi-config: nc-databse and nc-datadir” to the mounted drive at /media/PiDrive. In the folders for the db and data are some nextcloud files, but by copying files on the cloud, nextcloud claims there is no space left. Do I have to do something else?
Kind regards 🙂
That probably has something to do with your USB drive or the way you mounted it. Maybe the permissions/mount flags
Hi,
Thanks for your work and sharing it. I am successfully booted into the image on a Raspberry Pi 3.
Few things here that I am not able to work out:
* I am currently running it locally through an IP address and the browser says it is not secure. How can I solve that? I read that I can disable the https connection but I want to use it via Internet as well then that is not an option! When I ask the browser to remember the exemption for the IP address then the nextcloud gives a message asking to “Add as trusted domain”. I need to do it every time I change/update the domain?
* SSH is not enabled by default ?
SSH is not enabled by default. This is standard and is the default behaviour in Raspbian and is also desired to prevent people unadvertedly having an open SSH port with default `pi` credentials.
Read the post about Let’s Encrypt in order to obtain a trusted certificate. Actually, read all the posts, in particular the one about dnsmasq in order to use a domain name instead of an IP so you can access from inside or outside.
https://ownyourbits.com/2017/03/09/dnsmasq-as-dns-cache-server-for-nextcloudpi-and-raspbian/
https://ownyourbits.com/2017/03/17/lets-encrypt-installer-for-apache/
Thanks
Hi men!
Great guide and well scripted.
I have a question about the HTTP2 mod on the latest raspbian Pi3. When I try to install the HTTP2 module on the lastest apache from the default disto I get the following error message:
sudo a2enmod http2
ERROR: Module http2 does not exist!
How did you solve this problem?
Cheers!
Look at the code. I install a more recent apache version from the stretch repository
Hi man,
thanks a lot for the nice work and effort. I am not very skilled with web servers. After following your guide, I cannot open the website. This is what happens when I type https://192.168.1.100. The browser complains about it cannot be trusted, but I just clicked ‘proceed anyway’, and then:
This page isn’t working
192.168.1.100 is currently unable to handle this request.
HTTP ERROR 500
mmm I am quite lost and I do not know where to look at, any hints?
Thanks!
what steps or configurations did you take prior to the error?
[EDIT: look here https://github.com/nextcloud/nextcloudpi/issues/15 ]
I want to upload a 7 gig file but keep getting bad request error. Here is the message from the log. Max file size has been changed in both .htaccess and user.ini for 20000M
Sabre\DAV\Exception\BadRequest: HTTP/1.1 400 expected filesize 7039108893 got 2147483647
I was able to get some more information. It can upload fine via the windows program but only happens on the web interface. I have an older version of nextcloud with php5 and the web interface didn’t have that issue.
That seems like a NextCloud issue to me. I have also tried different sizes from the web interface and there seems to be a practical limit of ~800 MB.
What I did not suspect is that the sync client would not have that problem. That sounds strange.
I suggest you seek for help at the nextcloud forums or report the bug on NC github, I think it can be a bug with the web client.
[EDIT: there is an architectural limit of 2GB due to php 32bit limitations. I am working on a fix for this]
Hello, did you fix this issue ? We are in 08/2017 and I still have the same problem (Bad request for a big file). Please feel free to share the solution if you have found it. Thank you.
— COPYPASTE —
Hi, please ask technical questions or report issues on github. That way other people with the same issue can benefit from the answer.
Check first that it has not been asked before
— COPYPASTE END —
Would there be any restrictions on number of user accounts? Is there like 1 admin user and 1 regular user?
I had idea to create several users for family members. Managed to create one. Every additional user i want to add makes the webserver unresponsive until i reboot the pi through ssh.
Hello,
would you mind explaining configuration steps and details about the error that you are seeing here?
https://github.com/nachoparker/nextcloud-raspbian-generator/issues
This way we can better track the issue.
Thanks for the feedback
Hello,
just 2 questions; I’m using your last image:
1: I want to use the last version of fail2ban but I see it’s already installed but not active. can you confirm?
2: looking at apache log files I’ve seen the external ip address connecting to nextcloud is never the one of my ISP; which apache module is causing this behavior?
thanks!
1: yes
2: that is not strange. In any case, no apache module will ever determine what external address accessess your server.
[EDIT] moved to https://github.com/nachoparker/nextcloud-raspbian-generator/issues/14
hello,
please, could you copy-paste this here?
https://github.com/nachoparker/nextcloud-raspbian-generator/issues
thanks for the feedback
Thanks ! added
https://github.com/nachoparker/nextcloud-raspbian-generator/issues/14
I think I fixed it, not sure how but I left comments in the github link about both my setup process steps, how it appeared to break, and then how I tried to fix, ended up with NO web GUI, then how I reversed it and now it’s working ok.
awesome, good job!
that is very useful info for me to have someone else testing things and reporting how it went.
I’ll have a look at it later 😉
Dear Nachopacker,
Good to see you are so active. Tried today the new Nextcloud 12 image, still has issues with adding multiple users, however works in a way. Here’s what i am doing.
– Created SSD card, changed user pi password and enabled ssh
– Logged in on my local nextcloud as admin
– On admin -> users, added user1, works ok
– On admin -> users, added user2, now webserver becomes unresponsive
– By ssh sudo shutdown -r now
– Logged in on my local nextcould as admin, check admin -> users
On NextCloudPi 12 the user2 was created after all,
on previous NextCloudPi there was no user2.
So still undesired that admin -> users screen hangs the webserver.
However it now succeeds in a way.
Hello Rrrr
I just setup NC12 from scratch image and I was able to login as admin and create user1 and user2
I gave user1 admin group membership
user2 I created a new group called users for it
see my above posts but somewhere I lost access to the GUI and am maybe wondering if it was permissions (likely) or 2nd user add that broke it, although in my case rebooting didn not resolve it.
At any rate if you look at the github link above I comented and resolved my permissions issue BUT I was also able to delete and re create user1 and user2 and they both work without any adverse web GUI issues, you might consider trying that? just a suggestion since it worked for me.
It works fine for me here.
It must be an issue external to NextCloudPi, maybe your SD card or even power unit.
You can try doing it while running `top` from SSH to see what the rpi is doing when it becomes ‘irresponsive’
Again, please refrain from asking for support here, use
https://github.com/nachoparker/nextcloud-raspbian-generator/issues/
instead for that.
Thanks
Setting the week definition (Sat-Sun vs Mon-Sun)
The Calendar week definition is the US standard Sat-Sun. In Europe it is Mon-Sun. This setting is dependent on the Language setting in the personal settings which in this image has only has the option for English (US). Please could you consider adding English (British English) in a future update. See:
https://help.nextcloud.com/t/calendar-week-to-start-on-monday-not-sunday/5081
Thanks.
Sorry I meant Sun – Sat vs Mon – Sun
Sure, would you like to formally request this as an enhancement in https://github.com/nextcloud/nextcloudpi/issues ?
Hey! Great work! Loving how easy it is to setup everything. I’ve got only one problem: Can’t setup my external drive. The automount works flawlessly, but when I go to the nc-datadir option and set it to /media/Cloud (the drive’s name is Cloud) I get a message: “/media/Cloud is not empty” and nothing happens… The drive was formatted to ext4 on my Mac and has only the lost+found directory inside… What am I missing?
hi,
for `nc-datadir` you need to input either an empty folder that you have created or a folder name that does not exist and it will be created for you.
But if you input a folder that is not empty will refuse to use it.
Thanks for a great article. Very helpful.
Curious if you are aware of pagekite? http://pagekite.net/ Seems to be a smarter alternative to using DDNS. No router port forwarding settings to deal with. And for added security, why not use ZeroTier to create an encrypted network between the nextcloud on the pi and devices which will access it?
mmm I have not heard of those, only pagekite, but I haven’t seen into it. I’ll have a look at them, thanks 🙂
Hey Nachoparker,
I updated my PHP 7.0 using sudo apt-get update + upgrade and then updated my NC instance to v12.
Now I’m having the same error as these folks. https://help.nextcloud.com/t/php-opcache-not-correctly/12925/10
The admin console keeps saying that my opcache isn’t configured properly.
Is there anything I can do using nextcloudpi-config to fix this without losing all my data? I’ve modified the php.ini files in cli and fpm, restarted apache. Modified opcache.ini file. Restarted, no avail 🙁
I should note that my Rpi3 installation was originally done with Nextcloudpi and it’s been running incredibly smoothly!
how did you update? did you update through the internal updater ?
Did you move your datadir? do you have anything else? contacts? calendars?
Hi there, the other day the installation just died. apache seems to be up and running, i can ssh into nextcloudPi but no webdav nor https to the cloud. any suggestions for troubleshooting?
best sfb
did you do anything special? any update on the system or anything?
thanks nachoparker for replying;
no, maybe an unattended one but other than that, no – it was the hottest day yet in Berlin an the device was real hot. otherwise no.
When i connect to the server via browser it just gives me a blank page no error or anything like it, I really don’t know where to start troubleshooting
you can start by reading the logs `tail -f /var/www/nextcloud/data/*.log` (assuming you did not move your datafolder)
Same here!
Mine just died aswell..
At first, Apache didn’t start anymore.
Now it’s running but it doesn’t load any page anymore…
Maybe it has something to do with the letsencrypt renewal?
It’s about 1 month now since I installed it. Any thouhts on this?
Apache Log doesn’t tell anything spectacular.
wow, I have not had that issue. Would you kindly open a report here so we can fix it ASAP?
https://github.com/nachoparker/nextcloudpi/issues
Same here. Just stopped working. SSH works but nothing else.
i moved my data so i tried:
tail -f /media/USBdrive/ncdata/nextcloud/data/*.log
but i get a permission denied.
I hope somebody can help.
Probably an issue with having the database in a USB drive that goes to sleep. Please, let’s keep support and technical question here
Can’t make it work 🙁
I installed NextCloudPi but when I open the IP of the the Pi in the browser (from PC in local LAN), it gives me the following message on a page with NextCloud logo in the background (translated from german by me and my english is not that good):
You access the server from a not trusted domain.
[ EDITED: transferred to https://github.com/nextcloud/nextcloudpi/issues/21 ]
Thought this would be easier 😉 Any advice would be highly appreciated!
Best Regards
Ralf
Hello,
Please, if you want to ask general questions, or general help use the forums https://help.nextcloud.com/c/support/appliances-docker-snappy-vm
If you have a specific technical question, or something does not work, please report it to be fixed at https://github.com/nextcloud/nextcloudpi/issues
Sorry, this was just the first page google took me to. I saw that people get questions about NextCloudPi answered here, so I posted my question here as well.
(Sorry for bad English, I’m German)
I have a Problem using your image, ipv6 and letsencrypt:
[ EDIT: moved to https://github.com/nextcloud/nextcloudpi/issues/22 ]
Hello,
Please, if you want to ask general questions, or general help use the forums https://help.nextcloud.com/c/support/appliances-docker-snappy-vm
If you have a specific technical question, or something does not work, please report it to be fixed at https://github.com/nextcloud/nextcloudpi/issues
Ok, thank you
Sorry for the delay, here is what the log says:
'==> /var/www/nextcloud/data/access.log /var/www/nextcloud/data/error.log /var/www/nextcloud/data/nextcloud.log <==
{"reqId":"WRTjwH8AAQEAAAQXTHgAAABI","remoteAddr":"94.223.166.113","app":"core","message":"Trusted domain error. \"94.223.166.113\" tried to access using \"abcdefeg.net\" as host.","level":2,"time":"2017-05-11T22:20:50+00:00","method":"PROPFIND","url":"\/remote.php\/dav\/","user":"--","version":"11.0.3.2"}'
I understand there is no place on the device left, which makes me wonder whether I configured the hard drive correctly, on the other hand there had been far more data on the device than the sd-card would store?
but there seems to be some certificate trouble too.
Can you make sense of it?
This part was lost in the reply:
log_config:warn] [pid 1366:tid 1698690096] (28)No space left on device: [client 178.8.22.79:55972] AH00646: Error writing to /var/www/nextcloud/data/access.log
It does seem like you run out of space. Did you move the datadir to an external USB drive?
If something did not work for you, please report it here
https://github.com/nextcloud/nextcloudpi/issues/
all right, sd ran out of space. though the data folder is located on a harddrive. cloned the system on to a lager sd, now everything works again. thanks nacho
Hi, as I understand it, because of the architecture rasbian os , the maximum download file is only 2GB?
File handling
Maximum upload size
16 GB
(max. possible: 2 GB)
It is because of a limitation in 32bit php. I am working on a fix for this.
OK, Can use 64 bit raspbian architecture.
https://github.com/bamarni/pi64/releases
Thanks, the problem for this approach is that the RPi2 is not 64 bits. I am working in something else 😉
I flashed the img, navigate to the IP and it was taking forever to load. Then this:
Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
Apache/2.4.25 (Raspbian) Server at 192.168.1.90 Port 443
Not what I was expecting to see. What is the issue? Thank you
Hello,
If something does not work for you, please report it to be fixed at https://github.com/nextcloud/nextcloudpi/issues
The first time it takes longer as it is catching the php requests.
Thanks for the feedback
If I wanted to install this on an existing running raspian installation (I do not want to create a new image, but add this to an existing one), I should run ./nextcloud.sh with the
Resize and part of the Update sections removed?
You are right, Nextcloud and also the extras can be installed individually.
From your PC, remove those sections, and then the following command will install the webserver and database through SSH (assuming your rpi in 192.168.1.15)
`./installer.sh nextcloud_lamp.sh 192.168.1.15`
The following will install nextcloud on top of it
`./installer.sh nc-nextcloud.sh 192.168.1.15`
See the documentation about user and password
https://ownyourbits.com/2017/03/05/generic-software-installer-for-raspbian/
I am currently separating the first step in two, so the resizing and updating would be in step 0 for this same purpose.
I must be missing some code. All the code posts I see above are called nextcloud.sh and install-nextcloud.sh. You reference nextcloud_lamp.sh and nc-nextcloud.sh in your post above. What have I missed?
Thanks!
Sorry, that file structure has changed a bit, and the code from the original post was also a little bit old. I just updated it.
In any case, check out the git repo if in doubt 😉
If you get stuck or have further technical questions about the project, I recommend that you access the forums or the corresponding github section (see links at the top of the post)
I changed the admin password, but in the file /var/www/nextcloud/config/config.php there is the line ‘dbpassword’ => ‘ownyourbits ‘. Is this a security problem?
That is the database password. Definitely a good thing to change it, not only in that file but also for the database. In any case, if some attacker had permissions to read that file, they would already have permissions to access the database content through NC.
Hey this guide/project really helped me. Do you have a Bitcoin address I could tip?
Thanks for your generosity, but for now this is a hobby project and I do not take donations.
If anybody wants to help, contributions, testing and feedback are really welcome 🙂
Thank you for the image!
I cannot access the console after the system boot up, what is the default password for nextcloudpi?
Please, check here if you question has already been answered before asking.
Your question has already been asked here
i have 1 external usb hdd, i would like to use it for “nextcloud” “torrent download” and “samba share” for my TV.
can i do this? i’ve concerns about permissions. (e.g. hdd includes 2 folders one for Nextcloud and one for samba share and torrent download)
a few times i did samba share FIRST for my tv and THEN installed Nextcloud or Owncloud and never get permissions to write nextcloud data to external drive
See this post about using SAMBA with NextCloudPi. You can set it up with adecuate permissions from `nextcloudpi-config`.
For discussion, please use the forums. For technical questions or support, please, use github
Hello! Great Guide and easy install.
But I cannot sync my CardDav and CalDav with my different Devices: Thunderbird/Lightning, Android CalDAV-Sync and CardDAV-Sync. Any ideas?
File sync works.
Just tell me if you need more information or if I should ask somewhere else.
There is an fault in the Link you get from Nextcloud 12.0.0
Contacts
https://xxx.xxx.xxx.xxx/remote.php/dav/addressbooks/users/USER/contacts/
Instead of
https://xxx.xxx.xxx.xxx/remote.php/carddav/addressbooks/users/USER/contacts/
Calendars:
https://xxx.xxx.xxx.xxx/remote.php/dav/calendars/USER/CALENDAR/
Instead of
https://xxx.xxx.xxx.xxx/remote.php/caldav/calendars/USER/CALENDAR/
WTF! This was it, thank you very much! A shame something like that make it into a stable release but mistakes happen.
lol I guess mistakes do happen
Strange problem occurred. Your solution worked with my user account on the Android device but not in Thunderbird, more strangely the admin account syncs fine with Thunderbird. I only chance dav to caldav but it still disables itself but works fine on android.
Sorry for the Spam but I created a new calender and it works now. Something more is buggy the some missing letters.
I cheered too fast! It still doesn’t work with my user account in thunderbird. I will shut up now
NextCloudPi is great, but we ran into a problem early on, and almost gave up and moved on to something else because we didn’t realize what was happening.
We have a hard drive connected and made the mistake of using the nc-database option to move the database to the hard drive. After doing that, any time the Pi was rebooted and we tried to access the web interface, it would go to a blank white screen. Moving the database to a different location would make it work again, but only until the next reboot. We finally moved it back to the SD card, and then the web interface would come up after a reboot without an issue.
The first problem is we didn’t remember where it was originally saved, we would have liked to have put it back there but didn’t remember the original directory path. So maybe for the nc-database option, “restore to original location” should be a choice. Would you please reveal where the database is normally saved if you haven’t moved it?
But the second is I think we have stumbled across a race condition and NextCloud is losing (or winning, actually, but that’s not what we want). My guess that NextCloud is coming up before the external drive(s) are fully mounted. So maybe what you need is an additional option in the nc-database script or elsewhere that allows you to specify a “sleep” time in the NextCloud startup, to give hard drives time to spin up and initialize.
Thank you for all the time you have put into this!
Thank you very much.
I am getting many reports of that, like this Issue.
Getting a white screen is an indicative that the USB drive is not on, has been removed, has decided to go to stand by or something similar.
I am going to make it more clear in the `nextcloudpi-config` instructions that this is a potential issue with moving the database.
Your second issue… I am afraid I do not understand it very well.
In any case, I would like to ask everyone to report issues, ask technical questions and feature requests in the corresponding Github section for the project.
It is much cleaner and easier to manage, keep conversations separate, request for more information and such.
Thanks for the feedback
Mr Lizard, it works perfectly and smothly. My I suggest a new feather : add an automatic renew of the ssl certificate?
I am glad!
Well, that feature has been there from day one. Look at this comment.
In any case, please place feature requests in github. It is so much cleaner 😉
Hi! I’m so glad I came to look at this. I remember I had posted a couple months back, but never received a heads-up e-mail of your response. I don’t believe that matters all that much, today, because…
I’m going to perform a full upgrade using the version 12.0.0 image at the top of this page. I have the image, now, but am holding off upgrading for a week. This will be a complete fresh install into a formatted SD card and formatted external HDD (the ones in use, today) I wish there was a simple command line command that would kick off an upgrade, otherwise I would do it, this weekend.
What do you mean a command line that would kick off an update?
If it is what I think it is, you have `ncp-update` for that.
Looking at your previous comment
https://ownyourbits.com/2017/03/17/lets-encrypt-installer-for-apache/#comment-258
It seems that you have a very old version of NCP that did not have remote updates yet.
I recommend that you do the upgrade as you are planning to do, and from then on, you will be able to upgrade from the command line without having to start from scratch.
It must be. It appears I may have had pulled and older full version. I have a couple of them. I kicked off that command and received…
sudo: ncp-update: command not found
It appears a full upgrade from scratch is needed. I did some screen grabs to know what to put back in. It won’t take too too long. Luckily, I pulled the 12.0.0 for this upgrade and let folks know I’ll be performing it, next weekend.
I did notice syncing large video files (and/or groups of the same) takes quite a long time to sync and that just direct uploads from inside the application, itself, seems to yield better results.
Apologies if this has been asked, but is this image compatible with the rpi 1?
Hi,
I have not tried it. Somebody around here made it work on a raspi zero though.
My guess is that it should work, although it will be slow. Last time I checked, you could flash Raspbian on a Raspberry Pi 1, and this is based on Raspbian so it should work.
Let us know if you try!
Someone have problem com “smbclient”? In my image, external storage show “smbclient” in not installed.
As of today it does not come pre-installed. You have to install it yourself with `apt-get install smbclient`.
It is true that it deserves being included in the build. I will do that for the next release.
[EDIT] it comes pre-installed now
I have done a full build using the image and it works phenominally. Excellent work!
I had one issue that was encountered after running the LetsEncrypt process in the config utility. I don’t know if it was present, beforehand, but I just rectified it after a day mulling it over.
What was happening was …
[ADMIN EDIT] Shadowstreik replicated this info in this github issue, so I will remove the details from here.
Thanks for the feedback! We will continue this conversation on github
Hello, i used Etcher to write the image on a sd card, but Etcher says “Invalid image” “NextCloudPi_06-28-17.tar.bz2 is not a supported image type.”
I Hope you can help me. Should i use a other Programm to write?
the `.tar.bz2` file is the compressed image. You need to uncompress it first, and write the `.img` file.
Hi,
Very nice work. 😉
Two questions :
– I’ve enable Let’s Encrypt, resulting a certificate valid for only two month. How do I renew (automaticly) the certificate ? Do I have to “sudo nextcloudpi-config” every two month ?
– I’ve been using a Pi 2 + owncloud + external USB SSD (no encrypted datas) for 2 years. I’m seting up a Pi 3 + Nextcloud (+ moved USB SSD from Pi2). If I want the same directory with ocdata to be used by Nextcloud (not the database), How do I make Nextcloud scan for files in the directory and updating Nextcloud database (assuming the path is right in config.php) ?
Hi,
Please, create two separate entries on Github with your questions.
I will gladly answer over there, so other people with similar doubts can find them. Also, it is cleaner than mixing different questions here.
Thanks
Ok
I have a Pi 3 and love the package. I am new to the pi and this is my first Pi project. I have a public IP address that I want to use for my pi. I have made the changes to the dhcpcd.conf file and I have rebooted but I am still getting the old IP that was used during install. Where else do I need to change the IP?
Congrats for your first pi!
Please, use the github tracker for technical questions, so others can see it.
I didn’t learn the first time and i accidentally changed my ncdatabase to ncdata on my harddrive instead of changing my my ncdata directory. Where was the database directory orignally?
`/var/lib/mysql`
Hi! I was re-reading this post and saw the portion about QEMU which led me to my question…
Is there a post, or a process not yet mentioned, that covers the creation an IMG of an already configured NCP instance? IOW, I have my instance all configured and data loaded, how do I create an image file (IMG)?
Thank you.
Hi,
Well, you can save a copy of your SD card at any time. Actually, that is a good thing to do in case your SD becomes corrupt.
It is also possible to use QEMU to generate an already configured image. You would have to clone the repo, introduce your configuration and start the build.
It takes like 4 hours to complete.
Hi,
I hope you can help me. Trying to install additional packages to a plain nextcloudpi installation (after apt-get update / dist-upgrade) fails…
For installing FHEM package I first need to install some perl helper packages, e.g. libdevice-serialport-perl:sudo apt-get install libdevice-serialport-perl
Reading package lists… Done
Building dependency tree
Reading state information… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libdevice-serialport-perl : Depends: perlapi-5.20.0
E: Unable to correct problems, you have held broken packages.
Why is a package on hold, which is it and why is it broken?
Thanks!
Hi, please ask technical questions or report issues on github. That way other people with the same issue can benefit from the answer.
Check first that it has not been asked before
Why large mkv file can not be played online (streaming)?
Hi, please ask technical questions or report issues on github. That way other people with the same issue can benefit from the answer.
Check first that it has not been asked before
Cheers
Does anyone have the status.php error?
Everything was working ok and suddently i have an error connecting to server
“cant connect to nextcloud at https://ipserver/status.php”
Anyone knows why?
help is much appreciated
Hi, please ask technical questions or report issues on github. That way other people with the same issue can benefit from the answer.
Check first that it has not been asked before
Hi,
didn’t know if its a bug or a feature:
I’ve used a 8 GB SD Card on my RPi and installed nextcloud apps but after a view apps I got the information that there is not enough space. I change the installation to a 64 GB card and got the same problem.
Is there any restriction in the installed apps?
Hi, please ask technical questions or report issues on github. That way other people with the same issue can benefit from the answer.
Check first that it has not been asked before
I set up a system with your image and it works like a charm. But when i try to synch my hdd (300 GB – 132000 Files), the system crashes and i have to reboot it. This didn’t happen with my “normal” nextcloud install i had before…
Hi, please ask technical questions or report issues on github. That way other people with the same issue can benefit from the answer.
Check first that it has not been asked before
What’s the difference between nextberry and nextcloudpi?
I have not tried Nextberry, but I think that
– It installs Nextcloud upon first boot
– It doesn’t have extras or web interface, I think, or it has different ones
Its just another different alternative build
I tried to run NextCloudPi on my RasPi 2 from the most recent image (NextCloudPi_08-08-17.img) but I am failing to connect to either the Nextcloud or the Webinterface even directly after installation with a 503 error: “Service Unavailable – The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.”
To me it looks like there is something wrong with the Apache / PHP configuration, as apache is throwing errors on every attempt to connect. Here are the first lines of the /var/log/apache2/error.log:
[admin edit]
Hope you can help me to fix this? Would love to get this up and running for my own little cloud. I allready tried different SDHC-cards and power supplies which were all working ok before and also md5 and etcher verification suggest that the image should be ok.
Hi, please ask technical questions or report issues on github. That way other people with the same issue can benefit from the answer.
Check first that it has not been asked before
Hi, I did check on github but didn’t find anything matching. The only somehow related issue is #88 (https://github.com/nextcloud/nextcloudpi/issues/88) but it is lacking the error messages in the apache log.
So far I simply don’t have a github account and didn’t want to create one for asking this single question. But maybe there are coming more, so I’ll create an account and ask again.
How do I integrate a portmapper service (ipv4 ipv6) like feste-ip.net in nextcloudpi?!
— COPYPASTE —
Hi, please ask technical questions or report issues on github. That way other people with the same issue can benefit from the answer.
Check first that it has not been asked before
— COPYPASTE END —
Sorry!
Done.
haha you’re fine 😀
thx
There is an update to Version 12.0.1. Can i do the update?
Of course, make sure to run `sudo ncp-update` first
I am getting the following error while setting up Lets Encypt:
IMPORTANT NOTES:
– The following errors were reported by the server:
Domain: XXXXXXXX
Type: connection
Detail: Fetching
To fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address. Additionally, please check that
your computer has a publicly routable IP address and that no
firewalls are preventing the server from communicating with the
client. If you’re using the webroot plugin, you should also verify
that you are serving files from the webroot path you provided.
— COPYPASTE —
Hi, please ask technical questions or report issues on github. That way other people with the same issue can benefit from the answer.
Check first that it has not been asked before
— COPYPASTE END —
Mr Lizard,
I’ve got headache with the wi-fi connection. After a week of August vaccation I lost the connection, Weired, I decided to start form the new image file.
1/ wifi is not reconized and I need to update the Pi to activate it (I have a chinese pi board, not sure this is important to know)
2/ then, I use to make the wifi setup through the wpa_supplicant.conf file and it sounds stange and does not work any more (I tried differents ways of setup : wpa_supplicant or nc-wifi). Did you change something on the latest version?
Hi olivier,
Let’s talk about that on github 😉
— COPYPASTE —
Hi, please ask technical questions or report issues on github. That way other people with the same issue can benefit from the answer.
Check first that it has not been asked before
— COPYPASTE END —
Hi
Just upgraded to stretch and nextcouldpi seem to have stopped working, any ideas where I should look.
Thanks
Dave
— COPYPASTE —
Hi, please ask technical questions or report issues on github. That way other people with the same issue can benefit from the answer.
Check first that it has not been asked before
— COPYPASTE END —
Hello,
If I install nextcloudpi on a Pi, can I access it from outside my home network ?
Thank you
Yes, if you configure your router to allow port forwarding to your Pi
Hi!
First of all, thank you for your work! It works flawlessly and saved me a lot of time trying to putting a working Nextcloud server together on my Raspberrypi 3
I have a question: as I moved both ncdatabase and swap on the same external HDD that I use for ncdata, it seems like the HDD never goes into standby (I issue the appropriate hdparm -S command at boot time from rc.local, to make the HDD go to sleep after 1h).
Can you tell me if this behavior is caused by the swap of ncdatabase? Is really the database so busy even when Nextcloud is “at idle” (i.e., not operating on files?). If so, would it be dangerous for the lifespan of the sdcard to move it back?
On the other hand, can this behaviour be caused by the swap file? I guess this is not the case, as the swap file hasn’t be touched anyway until now, but still…
Have you any suggestion to point me inthe right direcction to discover WHY the HDD never goes to sleep?
Thanks a lot in advance!
Hi,
Thanks for your words. Please, read the following
— COPYPASTE —
Hi, please ask technical questions or report issues on github. That way other people with the same issue can benefit from the answer.
Check first that it has not been asked before
— COPYPASTE END —
Hi
This package is great. Thank you so much for the ready to use solution.
I have few questions though cause I’m a newbie to Linux-Rasp stuff.
Using USB to store files and DB.
How can I verify that files are actually is stored on USB drive and /or discover if the USB drive is mounted successfully? (I’m probably asking a standard Linux question here)
In case that DB and files are stored on USB, is there any fail-safe option for booting if the USB device fails?
Using USB for storage is affecting system performance?
Hi,
see the following copypaste
— COPYPASTE —
Hi, please ask technical questions or report issues on github. That way other people with the same issue can benefit from the answer.
Check first that it has not been asked before
— COPYPASTE END —
Hi
I just started with pi3 and all OS around I want on this exactly your way, nextcloud. after all, is was work but I need put trusted side – my ddns for access outside, and also edit ports, my 80 and 443 is using by different accessories.
before I use VM and there ubuntu and owncloud. there I was all setup do in terminal. but there is complete different.
could be easily but not for me 😀 you got port forward problem is when I put my new port 84 is still there port 80 is well that I need take it out.
is any possible change to change everything in terminal – putty -ssh ??
thanks
we have decided to move technical questions to the forum so we can benefit from a better environment for discussion.
Please, open a thread here