Infrastructure
One small machine in my home runs my team's collaboration tools and the staging environment for every app I build. It has no open ports on my router, deploys staging on its own when code merges, and backs itself up three ways. I built it to learn the parts a managed platform hides, and I run it the way I'd want production run.
The server has two jobs. It runs the collaboration tools for a small team, and it hosts the staging environment for every app I build.
Production deliberately lives somewhere else: a separate cloud VPS with its own keys, secrets and database. Nothing is shared between staging and production, and staging holds no real user data, so a mistake here stays here.
The other job is learning. Managed platforms hide networking, TLS, identity, secrets, CI/CD, backups and monitoring. Running all of them myself, on hardware I own, means I have to understand each one.
The hardware is deliberately modest: a small team's tools and staging traffic don't need more.
Internet users reach Cloudflare's edge, which forwards traffic through an outbound-only Cloudflare Tunnel to the home server; the router has no open ports. Team devices reach private tools only over the Tailscale network. GitHub Actions deploys staging by joining the tailnet as a temporary device that may only run one SSH forced command. Inside the server, cloudflared hands requests to Caddy, which routes each hostname to team tools, staging apps or, over the tailnet only, private tools. All of them use a data layer of PostgreSQL, Redis and MinIO on internal networks only. Backups leave the server nightly to an internal HDD and encrypted to cloud storage, and weekly to an offline portable drive. Production runs on a separate cloud VPS with its own keys, secrets and database, connected only through GitHub Actions deploying the main branch.
Public traffic
Internet users
Team, testers, mobile apps
Cloudflare edge
DNS · WAF · Access · Tunnel
Team access
Team devices
Signed in to the tailnet
Tailscale
Per-group access rules
Deploys
GitHub Actions
Merge to dev
Temporary device
SSH forced command only
Home server
Ubuntu Server · Docker Compose · no open router portscloudflared
Outbound-only tunnel
Caddy
Routes each hostname to its container
Team tools
Invite-only
Staging
Behind Cloudflare Access
Private tools
Tailnet only
Data layer
PostgreSQL · Redis · MinIO
Internal Docker networks only, no ports on the host
Internal HDD
Nightly
Cloud storage
Nightly, encrypted first
Offline drive
Weekly, then unplugged
Not connected to the home server
Production: cloud VPS
Separate keys, secrets and database. Its only link to this setup is GitHub Actions deploying the main branch.
About ten self-hosted services, grouped by who can reach them. The colour of each label matches the trust boundaries in the diagram above.
Mattermost
Team chat, plus a deployments channel where CI results land.
Outline
Team wiki. Sign-in goes through Cloudflare Access (OIDC).
It's a Plan
Project and issue tracking. It replaced Plane.
n8n
Workflow automation. The editor sits behind Cloudflare Access; webhooks stay open.
Cal.diy
Scheduling. Booking pages are public; admin pages sit behind Access.
MinIO S3 API
S3-compatible object storage for staging apps, one bucket and key per app.
Infisical
Secrets manager. Staging apps pull their secrets from it at deploy time.
Portainer
Container management.
Uptime Kuma
Internal uptime monitoring and alerts.
MinIO console
Admin console for object storage.
PostgreSQL
One database and one least-privilege user per app, with separate dev and staging databases.
Redis
One logical database per app.
MinIO
Object storage behind the S3 API above.
Staging App 1
Web front end, API and background worker.
Staging App 2
Same pattern: web front end, API and background worker.
Adding an app follows a copyable checklist: its own hostname, database, bucket, secrets project, monitors and CI/CD. A new app goes from nothing to a working staging environment in under an hour.
dev, merge, and staging deploys itself. main is production, which deploys to the cloud VPS.dev, a GitHub runner joins my private network as a short-lived, tagged device that can reach only SSH on the server. Its SSH key is locked to a single forced command, so it can't open a shell, read files or forward ports.Six steps: open a pull request from a feature branch into dev; GitHub Actions runs lint, tests and a Docker build; merging to dev starts the staging deploy; the runner joins the tailnet as a short-lived tagged device that can reach only SSH; a single forced command takes a lock, pulls code and secrets, rebuilds and stops at the first error; the server posts the result to Mattermost and logs the deploy.
Open a PR
Feature branch into dev.
Checks
Lint, tests and a Docker build on GitHub Actions.
Merge to dev
The merge starts the staging deploy.
Join the tailnet
A short-lived, tagged device that can reach only SSH.
Forced command
Lock, pull code and secrets, rebuild; stop at the first error.
Report
The server posts ✅ / ❌ to Mattermost and logs the deploy.
main is production and deploys to the cloud VPS through its own pipeline.
A backup you've never restored is a guess.
Nightly, restic takes encrypted, de-duplicated snapshots of app data and database dumps on the home server and sends them to an internal backup HDD and to cloud storage offsite. Weekly, a portable drive is plugged in, receives a copy, and is unplugged and stored away from the server.
Home server
App data and database dumps
Backup HDD
On-site, inside the server
Cloud storage
Offsite
Portable drive
Plugged in, copied, unplugged, stored away
Published ports skip the firewall
Docker writes its own firewall rules, so a published port is reachable even when UFW says deny. Nothing here binds publicly; only the tunnel and Tailscale get in.
Don't weaken the edge for CI
Cloudflare's bot protection blocked GitHub's runners on every public hostname. Instead of punching holes for CI, I moved health checks and deploy notifications onto the server itself.
Infrastructure belongs in config
A container I'd attached to a network by hand lost its fixed address after a restart, and another container took it. The fix was declaring the network and address in Compose and reserving that address outside Docker's automatic pool. Commands you ran once aren't infrastructure.
Open source moves under you
The upstream MinIO repository was archived, so I moved to a maintained fork. A project tracker didn't fit how the team worked, so I migrated everyone to another one. Plan for both.
Free tiers have real walls
Cloudflare's free certificate covers one subdomain level, so every hostname stays flat. Knowing the limits early saves a redesign later.
A UPS with automatic clean shutdown
Replace the current UPS with one that tells the server to shut down cleanly when the battery runs low, so a long outage never cuts power mid-write.
32 GB of RAM
Double the memory from 16 GB to 32 GB, for more headroom as I add staging apps.