It all started with an ad blocker on a first Raspberry Pi: that project got me into self-hosting. I then wanted to host my own services, at home, on my own hardware.
The server runs on a Raspberry Pi 5 with an SSD, in a case that handles power and management of the whole unit. It hosts family cloud storage and a video library, like a personal Netflix. The services run in Docker containers and are exposed on my own domain through a Cloudflare Tunnel, without opening any port on my router.
Hardware
Part
Details
Computer
Raspberry Pi 5, 4 GB RAM
Storage
1 TB NVMe SSD in ext4 (916 GB usable), mounted automatically at boot
System
Raspberry Pi OS Lite 64-bit, no desktop
Administration
SSH from the local network, containers managed with Portainer
Services
Service
Role
Nextcloud
Family cloud: one account per family member, file sync and a shared folder
Jellyfin
Video library, with separate libraries
Portainer
Admin interface for the Docker containers
cloudflared
Cloudflare tunnel client, linking the server to the internet without opening a port
Nextcloud and Jellyfin share the same folder on the SSD: a video the family drops into Nextcloud shows up automatically in Jellyfin.
Architecture
The key part is the Cloudflare tunnel: the Raspberry Pi opens an outgoing encrypted connection to Cloudflare, and Cloudflare then routes visitors through that tunnel. My router therefore has no open port, and my IP address is never exposed. Each service has its own subdomain, served over HTTPS by Cloudflare.
Server architecture, with domain names replaced by generic values (diagram in French)
When the Raspberry Pi is off, the domain shows a 502 error: Cloudflare still answers, but can no longer find the server at the other end of the tunnel.
Problems solved
Problem
Cause
Fix
SSH connection refused after a reinstall
The Pi's host key changes with every reinstall
Removed the old known key (ssh-keygen -R)
Nextcloud data on the SD card
Docker volume created by default
Recreated the container with its data on the SSD
SSD missing after a reboot
Drive not declared in /etc/fstab
Added the SSD to fstab for automatic mounting
Portainer unreachable through the tunnel
The tunnel pointed at Portainer's HTTPS port
Routed to the internal HTTP port, with HTTPS handled by Cloudflare
Nextcloud rejected the domain name
Domain missing from trusted_domains
Added the domain with Nextcloud's occ tool
Shared folder unreadable in Nextcloud
Wrong file owner
Gave the folder to the web server user (www-data)
File sharing "not allowed"
Sharing API disabled
Enabled it in the Nextcloud admin settings
Next steps
Automatic backups to my NAS: right now all the data sits on a single SSD
Cloudflare Access authentication in front of the admin interfaces
Host Overleaf Community Edition to share LaTeX projects
Move from docker run commands to a versioned docker-compose file (already prepared in the GitHub repo)