Kategorien
Software

Nextcloud with an RPi

To complete my home network, I installed Nextcloud with an RPi.

The bigger vision is to get independent of the big companies, specifically from the US companies.

Let’s see which services I will provide with my own cloud, options are:

  • Files
  • Contacts
  • Calendar
  • Photos

It’s quite easy to use a package specifically built for the RPi called Nextcloudpi.

Nextcloud with an RPi

However, it does not run in a docker container, as the providers stopped creating an image. On the other hand, you can adjust much more on the LAMP system itself.

I just followed https://help.nextcloud.com/t/raspberry-pi-4-booting-from-usb-device-no-microsd/126320 and https://help.nextcloud.com/t/how-to-access-nextcloudpi-first-time-activation/126309 for the setup.

After that, everything was running locally already.

It became tricky with accessing the nextcloud server from outside my local network, as I had to configure the Reverse Proxy (NPM) accordingly.

The prerequisite is that you have configured a domain and routed that to the Dynamic DNS server.

At the NPM side the configuration looks like that:

Proxy Host:

  • Scheme: http
  • Cache Assets: On
  • Block Common Exploits: On
  • Websockets Support: On

SSL Certificate:

  • Force SSL: On
  • HTTP/2 Support: On
  • HSTS Enabled: On
  • HSTS Subdomains: Off

Advanced:

location / {
    proxy_pass http://yourIP_of_the_Nextcloud;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
  }

location /.well-known/carddav {
    return 301 $scheme://$host/remote.php/dav;
}

location /.well-known/caldav {
    return 301 $scheme://$host/remote.php/dav;
}

location ^~ /.well-known {
    return 301 $scheme://$host/index.php$uri;
}
proxy_hide_header Upgrade;

At nextcloudpi configure the following parameters:

nc-trusted-domains
nc-trusted-proxies

Very important is also to switch off the Force SSL at the Nextcloudpi configuration!

This means we are now terminating the SSL at the Reverse Proxy (NPM), as usual. The communication between the Reverse Proxy and the Nextcloud server runs via http.

Von Gerhard Vogt

Born in Munich, but living more then 10 years now in the lovely Stuttgart area.
Grown up in a technical environment, moved then into the project and people management.
I'm interested in plenty of outdoor sports like sailing, biking, skiing, hiking, but also ball sports like tennis and badminton.
Travelling the world, and making photos is another hobby.
Never get bored! :-)

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert