Ansible-managed distributed-servers fleet (Forgejo copy of the GitLab repo)
  • Go 32.8%
  • Jinja 27.2%
  • Vue 10.2%
  • JavaScript 10.2%
  • TypeScript 8.6%
  • Other 11%
Find a file
2026-11-17 12:18:37 +00:00
.superpowers/sdd chore(sdd): regenerate task-6 report (Activity Pinia store) 2026-07-16 15:48:22 -05:00
docs restic: stop backing up Garage blobs, flatten forget groups, clear stale locks; forgejo: disable source archives 2026-11-09 00:01:08 -05:00
inventory restic: stop backing up Garage blobs, flatten forget groups, clear stale locks; forgejo: disable source archives 2026-11-09 00:01:08 -05:00
playbooks site_mirror: the websites survive the elitebooks dropping off the mesh — read-only bucket mirror on bens-mac-04 as the last Caddy upstream 2026-09-06 22:40:18 -05:00
roles swarm_runner: stop reinstating rootless docker; the role matches the 2026-08-12 rootful cutover 2026-11-17 07:18:20 -05:00
scripts push_relay_proxy: push.<domain> — ride the wildcard record and cert, drop the DNS toil 2026-09-03 15:06:40 -05:00
.gitignore docs(security): Part A close-out state (A0-A3 outcomes) + masterkey research note 2026-07-17 16:01:37 -05:00
ansible.cfg chore: enable ansible-vault password file + ignore .superpowers/ 2026-06-16 18:30:23 -05:00
CHANGELOG.md swarm_runner: review follow-ups on the runner-unit fence (#20, PR #21) 2026-09-27 22:32:22 -05:00
CLAUDE.md docs(agents): add CLAUDE.md + agent-workflow docs (issue tracker, triage, domain) 2026-07-03 15:11:47 -05:00
CONTEXT.md docs(admin-dashboard): Activity page design spec + ADRs + glossary 2026-07-05 00:27:51 -05:00
Makefile swarm_runner role (2/2): runner registered + service + prune — elitebook-03 live in the pool (label swarm, workflows still pinned) 2026-08-11 16:00:33 -05:00
README.md changed images 2026-05-17 19:11:56 -10:00
requirements.yml role(restic): cross-replicated backups across the EliteBooks 2026-05-11 16:13:38 -10:00
secrets.yml.example coa_shared: render FORGEJO_TOKEN into keri/.env.secrets so in-app issue reports can be filed (infra #28) 2026-10-21 00:14:44 -05:00
SETUP-COMMUNITY-SERVER.md refactor(community-server): rename + portability + fresh-fork onboarding 2026-05-17 12:25:42 -10:00
SETUP-HOST.md netbird access model + zitadel.* console alias 2026-06-19 04:29:09 +00:00

Matou Distributed Servers

Self-hosted websites and file storage for your community — running on computers your community already owns.

image

What is this?

Matou Distributed Servers is a way for a community to run its own websites and file storage — without renting space from Google, Dropbox, or Squarespace.

You set up:

  • One small public server in the cloud (the "host"). It's the front door — the part of the internet that the public can actually reach.
  • One or more local servers in your community (any old laptop, a Raspberry Pi, an unused desktop). These hold the actual files and websites.

The host and the local servers connect to each other over a private network that only your community can see. When someone on the public internet visits one of your community's websites, the host quietly forwards the request over the private network to whichever local server has the content.

The result, from the visitor's perspective, looks identical to any website hosted on Google Cloud or AWS. From your community's perspective, everything is running on hardware you own and control, in your own homes.

Why we built it

Most of what we use the internet for — websites, photos, documents, shared calendars — sits on machines owned by a handful of very large American companies. That's convenient until it isn't. Costs creep up. Terms of service change. Accounts get suspended. Rural and remote communities pay the most for the worst service.

This project is one community's attempt at a different answer. The hardware lives in our community. The data lives in our community. If the underlying internet is slow or expensive, that affects how fast the public sees our pages — but it doesn't affect whether our community can use the service. And if the cloud provider for the public host disappears tomorrow, the data is still safe at home; we just need to re-route the front door.

Concretely, what's running today:

  • Public community websites at addresses like 01.matou.nz, 02.matou.nz. Operators upload sites through a simple drag-and-drop page; the site appears in seconds, replicated across every community server.
  • Self-hosted file storage (Nextcloud — think Google Drive or Dropbox, but the files are on your friend's spare laptop instead of Google's servers). Sign in once, get a web folder you can sync to your phone or laptop.
  • Single sign-on (ZITADEL) so people only have one account across every service the community runs.

image

How it works

Two kinds of machines, joined by a private mesh network:

The host

The host

A small rented cloud server (we use a $6/month DigitalOcean machine). It does just two jobs: terminate HTTPS for your community's domain, and forward traffic over the private mesh to the local server that holds the requested content. The host stores no community data itself — it's fully replaceable. If you lose it, you can rebuild a new one and re-route DNS in under an hour.

The community server

A community server

Computers physically in your community — anywhere with a power outlet and a home internet connection. They run the actual services (file storage, website content) and replicate files to each other so no single computer's hard drive is a single point of failure. When one server is offline (power cut, someone tripped on the plug), the others keep serving.

The private mesh network

Private mesh network

What ties the host and the community servers together. We use Netbird (an open-source layer over WireGuard) so all the machines can find and talk to each other directly, even when the community servers are behind a home router with no public IP and no port forwarding. From the host's perspective, every community server looks like a directly-reachable peer; from the community server's perspective, it never has to be exposed to the public internet at all.

Step-by-step setup

The setup happens in two phases: first the public host, then each community server. This is the bird's-eye view — for the full procedure (every command, every edit, troubleshooting), follow the linked setup docs.

Phase 1 — set up the host

Phase 1: the host

You need:

  • A domain name (e.g. your-community.org, ~$15/year).
  • A small cloud VPS running Ubuntu LTS, ~$6/month is plenty (DigitalOcean, Hetzner, Linode, Vultr — anything with a public IP works).
  • A laptop with ssh, git, and ansible.

What you'll do:

  1. Customise the inventory for your community — domain, admin email, community-server hostnames, secrets.
  2. Provision a fresh Ubuntu VPS at your cloud provider.
  3. Add the DNS records from docs/DNS_RECORDS.md at your registrar.
  4. Run make host.
  5. One-time UI steps in the dashboards the host playbook just brought up: set the ZITADEL admin password, mint a PAT, generate a Netbird setup key.

Result: a working public host with a wildcard HTTPS cert, the private-mesh control plane, an admin dashboard, and monitoring. About 15 minutes.

📘 Full procedure: SETUP-HOST.md

Phase 2 — set up each community server

Phase 2: each community server

You need:

  • One or more computers in your community: old laptop, Raspberry Pi 4/5, Zimaboard, mini-PC, refurbished desktop. Anything that runs Ubuntu Linux.
  • A home internet connection — any speed; the mesh handles NAT traversal even on Starlink, mobile, or CGNAT-locked broadband.
  • The same operator laptop from Phase 1.

What you'll do, per community server:

  1. Install Ubuntu Server on the box.
  2. Add the box to inventory and create its per-host config (copy the template at inventory/host_vars/community-server.yml.example).
  3. Run make community-server LIMIT=<your-server-name>.
  4. Once enrolled, swap the inventory's ansible_host over to the mesh IP so future runs go over the mesh.

Result: the server appears at https://<short_name>.<your-domain>/. With three or more servers joined, you get a 3-copy storage cluster with automatic fallback and daily cross-replicated backups. About 10–15 minutes per server.

📘 Full procedure: SETUP-COMMUNITY-SERVER.md

After both phases — what you've got

  • A 3-copy file-storage cluster (each file lives on every community server — survives losing any one).
  • Public websites that load from any community server, with automatic fallback if one is offline.
  • Daily encrypted backups cross-replicated between the community servers.
  • Self-hosted file storage (Nextcloud) and single sign-on (ZITADEL) running on hardware you own.
  • A clean operator workflow: make host re-applies the host config, make community-server LIMIT=... re-applies a community server. Both are idempotent — re-running is always safe.

A note on "EliteBooks" in the inventory

The project's documentation and commands use "community server" as the generic term, but inside the inventory you'll still see hostnames like elitebook-distributed-server-01. That's a historical artifact: the machines we happened to have on hand for this deployment were old HP EliteBook laptops salvaged from an office upgrade, and renaming the hostnames after deployment would break the existing Restic backup repos, Garage cluster identities, and Netbird peer registrations that are keyed on those names. The Ansible roles themselves are hardware-agnostic — any computer that runs Ubuntu Linux works:

  • An old laptop with a dead screen (just close the lid; the project configures the laptop to keep running).
  • A Raspberry Pi 4 or 5.
  • A second-hand mini-PC.
  • A purpose-built NAS box.

For a fresh fork of this project on different hardware, change the hostnames in inventory/hosts.yml and the matching host_vars/ files to whatever name fits. The role library doesn't care.

Current limitations

This project is real and running, but be honest with yourself about what it is and isn't:

  • Single point of failure for application UIs. Files in storage are replicated three times, but the Nextcloud web app itself runs on one community server. If that one server goes down (power cut, network blip), Nextcloud's web interface is unavailable until it's restored — even though all the files are still safely on the other two servers. Recovery is a documented operator procedure, not automatic.
  • No off-site backup of file content yet. All three copies of your files live in the same community. If a disaster destroys the whole community simultaneously (fire, flood, theft of all three machines), the files are gone. The metadata (databases, configurations) is backed up small enough to copy off-site cheaply, but the file bytes themselves currently aren't. We're tracking the fix; until then, treat it as: "as durable as the cluster, no more."
  • Operator-led, not user-led. Setting this up requires comfort with the command line, SSH, and DNS records. We're working on making it easier, but today it's not "click here to install" simple.
  • The host depends on a cloud provider. The community servers are yours, but the public host (the front door) lives on a rented VPS. You can switch providers easily and rebuild quickly, but you do need some provider with a stable public IP.
  • Internet-bandwidth dependent. A community on a slow connection will serve slow public websites. The local file-sync experience is fast (it's local!), but public visitors are bottlenecked by your community's upload bandwidth.

What's next

Things we plan to add as the project matures:

  • Automatic failover for application UIs (high availability). When a community server hosting Nextcloud goes down, another server takes over automatically — no operator action needed, no downtime.
  • Off-site / off-grid backups. Adding a fourth machine in another location (a friend's house in a different town, on a different internet connection) — or using cheap cloud storage like Backblaze B2 — to protect against whole-community disasters.
  • More community apps. Beyond websites and file storage: chat (Matrix), git/code (Forgejo), shared calendars (Radicale), photo galleries (Immich), federated social (Mastodon, Bonfire). The authentication and storage layers are already in place; each new app is one playbook away.
  • Multi-community federation. Two communities, each running their own Matou stack, sharing federated services with each other (e.g. inter-community Matrix chat, shared events, mirrored backups across community boundaries).
  • Easier installation. A guided installer that handles DNS, inventory, and secrets through a friendly UI, not a config file.

Get involved / questions

This project is being developed openly by Matou Collective — with a small community in the Cook Islands. If you're interested in setting this up for your own community, or just want to ask questions about how it works, get in touch (ben@matou.nz or ian@sunriselabs.io).


For operators

If you're setting this up (or maintaining an existing deployment), start here:

For the development history of this README and what state the deploy is in at any given moment, the CHANGELOG is the source of truth.