👨‍💻 about me home CV/Resume 🖊️ Contact Github LinkedIn I’m a Haskeller 📝 Blog Freedom, privacy, tutorials… 🏆 Best of panda upp Haskell abp pp hCalc bl todo pwd TPG Nextcloud Git BitTorrent

📰 Friday 2. April 2021: upp is a panda companion. It’s is a Lua-scriptable lightweight text preprocessor.
🆕 since December 2020: Playing with the actor model in an embedded multicore context. C imperative components become C stream pure functions with no side effect ➡️ C low level programming with high level pure functional programming properties 🏆
📰 Saturday 30. January 2021: Playing with Pandoc Lua filters in Lua. panda is a lightweight alternative to abp providing a consistent set of Pandoc filters (text substitution, file inclusion, diagragrams, scripts, …).
🆕 Sunday 24. May 2020: Working at EasyMile for more than 4 years. Critical real-time software in C, simulation and monitoring in Haskell ➡️ perfect combo! It’s efficient and funny ;-)
🚌 And we are recruiting! Contact if you are interested in Haskell or embedded softwares (or both).

Nextcloud setup on Raspberry Pi 4 the easy way

Christophe Delord


I don’t like Google’s way of eating my personal data. So I decided to self-host my personal cloud to protect my privacy and have full powers on my data instead of Google.

See also Git server on Raspberry Pi.


Raspberry Pi installation on an external HD (no SD card)

Warning: the following operations are dangerous, the whole external HD or SSD will be erased. Be careful not to accidentally crash other disks (such as the main HD of the PC you are using to install the Raspberry Pi OS image).

  1. extract the image

    unzip tar xjf NextCloudPi_RPi_11-27-20.tar.bz2
  2. plug the external USB HD and use lsblk to find its device name (/dev/sdX in the following example)

  3. flash Raspberry Pi OS (Warning: THIS IS THE DANGEROUS PART)

    sudo dd if=2021-01-11-raspios-buster-armhf.img of=/dev/sdX status=progress bs=4M
  4. be sure the cache is flushed before unplugging the disk


Temporary SSH activation

For an headless usage of the Pi, SSH must be activated before booting.

  1. mount the boot partition

    mkdir /tmp/boot
    sudo mount /dev/sdX1 /tmp/boot
    sudo touch /tmp/boot/ssh
    sudo umount /tmp/boot

First boot

  1. remove the SD card from the Raspberry Pi, it won’t be needed

  2. plug the USB HD or SSD

  3. connect the Raspberry Pi to your home router (Ethernet)

  4. power on

  5. wait for a few seconds…

  6. connect to the Raspberry Pi (the default password is raspberry and must obviously be changed!)

    ssh pi@raspberrypi.local
  7. add your SSH key to avoid typing your password at each connection (optional)

    mkdir .ssh
    cd .ssh
    vi authorized_keys # copy/paste your id_rsa.pub file or whatever ssh key you use)

Raspberry Pi configuration

ssh pi@cloud
sudo raspi-config
  1. System Options

  2. Interface Options

  3. Localisation Options

  4. Advanced Options

Quit and reboot…

Network configuration

The Raspberry Pi shall have a fixed IP address as it should be reachable from the Internet. The easy way is to use your home router to:

  1. assign a fix IP address to the Raspberry Pi (outside the DHCP range, e.g.

  2. assign a local network name to the Raspberry Pi (e.g.: cloud) (this may not be necessary)

  3. reboot

    sudo poweroff

    Unplug and replug the Raspberry Pi to the home router and power on.

  4. check the IP address and hostname

    ssh pi@cloud
    ip addr
  5. add NAT rules to your home router to get access from Internet: TCP ports 80 and 443 must be redirected to the Raspberry Pi (cloud).

  6. if you have a domain name you can also redirect a subdomain to your home router (see the documentation of your provider). I use a DNS record:

Nextcloud installation

The easy way to install Nextcloud is snap but I couldn’t finish the configuration remotely. So the workaround was to connect a monitor and a keyboard to the Raspberry Pi.

Locally on the Raspberry Pi:

sudo apt update
sudo apt install snapd
sudo snap install nextcloud --devmode
sudo snap start nextcloud
chromium-browser localhost

and follow the instructions to create the admin user and install some essential applications.


There are some simple instructions to add a free SSL certificate to your Nextcloud: https://www.techrepublic.com/article/how-to-install-nextcloud-with-ssl-using-snap/

sudo /snap/bin/nextcloud.enable-https lets-encrypt
sudo snap restart nextcloud

Import Google contacts and calendar

The excellent Nextcloud documentation gives cristal clear instructions:


A locally hosted Nextcloud is much better than Google:

My data center

My data center is pretty basic but yet an amazing alternative to Google (and this is cool!):

Look how small and pretty it is:

My Raspberry Pi data center

(nothing was bought on Amazon obviously!)