homelab / Case study
Self-Hosted Nextcloud & Scheduled Backups
Independent infrastructure project
A private Nextcloud service used daily for scheduled microSD backups to external USB storage.
Debian · Docker Compose · Nextcloud · PHP-FPM · MariaDB · Redis · Caddy · Cloudflare Tunnel · WebDAV · Round Sync
Read case study as Markdown ↗ambian@nextcloud-server
,g$$$$$$$$$$$$$$$P. -----------------------
,g$$P"" """Y$$.". OS: Debian GNU/Linux 13 (trixie) x86_64
,$$P' `$$$. Host: HP Pavilion Power Laptop 15-cb0xx
',$$P ,ggs. `$$b: Kernel: Linux 6.12.94+deb13-amd64
`d$$' ,$P"' . $$$ Uptime: 3 days, 1 hour, 26 mins
$$P d$' , $$P Packages: 879 (dpkg)
$$: $$. - ,d$$' Shell: bash 5.2.37
$$; Y$b._ _,d$P' Display (LGD0532): 1920x1080 @ 60 Hz in 15" [Built-in]
`.`"Y$$$$P"' Cursor: Adwaita
`$$b "-.__ Terminal: /dev/pts/0
`Y$$b CPU: Intel(R) Core(TM) i7-7700HQ (8) @ 3.80 GHz
`Y$$. GPU 1: NVIDIA GeForce GTX 1050 Mobile [Discrete]
`$$b. GPU 2: Intel HD Graphics 630 @ 1.10 GHz [Integrated]
`Y$$b. Memory: 2.06 GiB / 7.65 GiB (27%)
`"Y$b._ Swap: 687.69 MiB / 7.88 GiB (9%)
`"""" Disk (/): 27.88 GiB / 224.97 GiB (12%) - ext4
Overview
I maintain a private Nextcloud service that I use daily to back up files from my microSD card. A script triggers Round Sync at 1 a.m. to check for new file versions and transfer updates through Nextcloud WebDAV to external USB storage.
The application runs on an HP Pavilion using Debian, with an internal NVMe SSD for application execution and an external Western Digital NTFS drive for bulk storage. The external drive remains connected continuously.
My Contribution
I deployed and maintain the Docker Compose stack, including Nextcloud with PHP-FPM, MariaDB, Redis, Caddy, and cloudflared. I configured host-level cron for Nextcloud background jobs independently of the device’s Round Sync schedule.
I also configured the supporting Ubuntu gateway and investigated server lockups, storage scanning issues, database consistency, reverse-proxy behavior, and stalled network transfers.
Architecture

Round Sync transfers updated files over WebDAV through Cloudflare and an outbound Cloudflare Tunnel connection established by cloudflared on the Debian server. Caddy routes requests to Nextcloud, which writes the files to the external USB drive. MariaDB stores application records, while Redis handles transactional file locking.
The Ubuntu ThinkPad gateway belongs to the same home infrastructure and handles routing, DHCP/DNS, and trusted/guest access restrictions. Its configuration is described in the related Linux Gateway, DNS & Firewall case study.
Evidence
The supplied Debian ASCII output records the host operating system, hardware, packages, and resource usage at capture time. Uptime and resource figures are snapshots, not live measurements or reliability guarantees. It replaces the previous dashboard image.
Three supplied Nextcloud administration screenshots show Status, Database, and Background jobs. They replace the old blurry monitoring crop and can be enlarged to their original resolution. Values describe capture time, not live monitoring. The Database capture shows 11 failing checks, 25 passing, and 1 skipped; no claim of a fully healthy database is made. The original screenshots are preserved unchanged; the application and personal files remain private.
The architecture image illustrates the service’s components and transfer flow; it is not a screenshot or proof of measured reliability.
Troubleshooting
I investigated recurring silent lockups on the Debian application server and applied persistent CPU C-state limits through a GRUB configuration drop-in. This served as a practical mitigation without establishing a definitive hardware root cause.
I investigated slow storage scans involving the external NTFS drive and its ntfs-3g driver. Following a mount-related incident, I used Nextcloud OCC commands to rebuild file-cache records and add missing database indexes.
I also investigated stalled requests across the gateway and tunnel paths, adding TCP MSS clamping through UFW’s configuration to address path-MTU-related transfer problems. Other troubleshooting involved Cloudflare settings, reverse-proxy configuration, application sharing behavior, and Nextcloud brute-force throttling.
Technical Details
Nextcloud runs with PHP-FPM alongside dedicated MariaDB and Redis containers. Caddy handles reverse-proxy routing, and cloudflared establishes the outbound tunnel used for public ingress without opening inbound router ports for the service.
The Round Sync script runs at 1 a.m. to check microSD files for new versions and transfer updates through WebDAV. Nextcloud’s host-level cron performs separate application background jobs.
The Debian server uses internal NVMe storage for application execution and an external USB-connected Western Digital NTFS drive for bulk storage. Tailscale provides remote administrative connectivity, while the related Ubuntu gateway uses dnsmasq, UFW/iptables, and AdGuard Home.
Backup retention and recovery testing are not documented in this case study, and no uptime percentage is claimed.


