Mattéo Pozzo di Borgo
Microengineering — between electronics, embedded systems and fabrication.
← Project timeline
Personal project Ongoing

Self-hosted server

A Raspberry Pi 5 hosting a family cloud and a media library, reachable on my own domain.

Period
Since summer 2025
Context
Personal project
Status
Ongoing
Raspberry PiDockerCloudflare TunnelSelf-hostingNextcloudJellyfinLinux
Raspberry Pi 5 server

The project

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

PartDetails
ComputerRaspberry Pi 5, 4 GB RAM
Storage1 TB NVMe SSD in ext4 (916 GB usable), mounted automatically at boot
SystemRaspberry Pi OS Lite 64-bit, no desktop
AdministrationSSH from the local network, containers managed with Portainer

Services

ServiceRole
NextcloudFamily cloud: one account per family member, file sync and a shared folder
JellyfinVideo library, with separate libraries
PortainerAdmin interface for the Docker containers
cloudflaredCloudflare 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.

Architecture diagram: users, Cloudflare, encrypted tunnel to the cloudflared container, then Nextcloud and Jellyfin on the SSD

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

ProblemCauseFix
SSH connection refused after a reinstallThe Pi's host key changes with every reinstallRemoved the old known key (ssh-keygen -R)
Nextcloud data on the SD cardDocker volume created by defaultRecreated the container with its data on the SSD
SSD missing after a rebootDrive not declared in /etc/fstabAdded the SSD to fstab for automatic mounting
Portainer unreachable through the tunnelThe tunnel pointed at Portainer's HTTPS portRouted to the internal HTTP port, with HTTPS handled by Cloudflare
Nextcloud rejected the domain nameDomain missing from trusted_domainsAdded the domain with Nextcloud's occ tool
Shared folder unreadable in NextcloudWrong file ownerGave the folder to the web server user (www-data)
File sharing "not allowed"Sharing API disabledEnabled 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)