Fork me on GitHub

Install a nextcloud box with NextCloudPi

Here is exposed steps to setup a nextcloud box on RPI consuming the nextCloudPi image . enjoy ;)

Nextcloudbox setup

  • burn a usb drive. NextCloudPi offers a fully configured box.

  • insert sd card and boot. Default credentials are: pi/raspberry

  • change keyboard layout if needed before getting crazy:

    • edit the XKBLAYOUT="fr" directive in /etc/default/keyboard:

    • reboot: sudo reboot now

  • enable usb device automount:

    sudo nextcloudpi-config
    

    then: nc-automount > active=yes

Wait a few seconds and check your drive is mounted using:

    sudo fdisk -l

Test it!

Locally

Behind a router/internet connection

  • Plug RPI to your router

  • Go to the admin panel

  • Perform port redirection to the RPI: external 443/internal 443.

It works, yeah! beer time!

Enter the RPI @IP in your web browser (https://10.42.0.100 in my case), after adding a security exception because of self signed certificate, you should see:

screenshot

credentials: admin/ownyourbits

External storage setup

  • format your usb-drive as ext4 and create a msdos partition table if necessary using gparted. The partition must be a linux partition kind to support linux right management.

  • change nc-database to the flashdrive: sudo nextcloudpi-config > nc-database

  • change nc-datadir to the flashdrive using: sudo nextcloudpi-config > nc-datadir

If everything goes well, you should see that data and database are stored in /media/USBdrive/ncdata and /media/USBdrive/ncdatabase

Enable and set up WIFI

You can enable and select your WIFI connection in: sudo nextcloudpi-config > nc-wifi > ACTIVE=YES

Enable SSH

SSH is not enabled by default, enable it in: sudo raspi-config > 5 Interfacing Options > P2 SSH You can now ssh the rpi machine:

    ssh pi@10.42.0.100

Default rpi credentials are pi/raspberry, CHANGE IT by running: passwd

Troubleshooting

Trusted domains issue

Fix it in editing nexcloud/config/config.php:

    ...
    'trusted_domains' =>
    array(
        ...
        3 => '10.42.0.100'
    )
    ...

screenshot

Connect to raspberry pi from linux host using a simple ethernet cable

This post describes how to connect a RPI to a linux station with a simple ethernet cable.

On debian host machine

  • run gnome-nettool, change the edit the wired connection and edit IPv4 settings.

    • Change the DHCP default method network conf

      to shared with other computer: network conf

  • power off the RPI

    sudo halt
    
  • mount the RPI SD card to the host PC

  • identify the PC eth0 @IP adress:

    sudo ifconfig
    

In my case: 10.42.0.1

  • edit the cmdline.txt located on the boot partition file adding:

    ip=10.42.0.100
    
  • The pi and the debian PC must on the same subnetwork ie: 10.42.0.XXX

  • insert SD card and boot RPI

  • check the connectivity:

    ping 169.254.6.100
    --- 10.42.0.100 ping statistics ---
    6 packets transmitted, 6 received, 0% packet loss, time 4999ms
    rtt min/avg/max/mdev = 0.326/0.351/0.392/0.028 ms
    

On the RPI machine

  • enable ssh:

    sudo raspi-config 
    
  • Interfacing Options then P2 SSH

SSH IT !

From the debian pc:

ssh pi@169.254.6.100

That was it! You are now connected over SSH on the RPI:

The authenticity of host '10.42.0.100 (10.42.0.100)' can't be established.
ECDSA key fingerprint is ca:cc:0c:80:ab:1a:b4:a9:4b:2b:a8:1a:fa:b4:7e:23.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.42.0.100' (ECDSA) to the list of known hosts.
pi@10.42.0.100's password: 



NextCloudPi v0.12.8 is up to date
Last login: Fri May 26 18:34:10 2017

SSH is enabled and the default password for the 'pi' user has not been changed.
This is a security risk - please login as the 'pi' user and type 'passwd' to set a new password.
pi@raspberrypi:~ $