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.

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.