Here is Yard in one sentence: one Linux VM runs every app in a Podman container behind Caddy, and a push to the repo deploys the app.
That sentence is the whole design. Everything else in this book explains one of its words: what “runs” means, what “behind Caddy” means, what happens between “push” and “deploys”. If you already know Podman, Compose, Caddy, and webhooks, you could build something like Yard yourself from that line. I did, and it came out small. This chapter is the map, so that nothing later comes as a surprise.
The problem#
You have a few small apps. Maybe one is a side project, one is a tool for your family, and one is the thing you hope becomes a business. Each needs a domain, a certificate, a place to keep its files, a way to read its logs, and a way to ship the next version without a ritual.
There are two common answers, and both cost more than they look.
The first is a platform: you push, it runs, and you pay per app, per seat, or per gigabyte. It is lovely until the bill grows, or the free tier goes away, or you need to know why something broke and the answer lives on a server you cannot open.
The second is a VM you set up by hand. It is cheap and it is yours. But six months later, nobody remembers which file configures nginx, how the certificate renews, or why the app runs as root. The server becomes a museum that you are afraid to touch.
Yard sits between the two. You get one VM that you own and can read, and the push-to-deploy feel of a platform. The trick is not clever code. The trick is that Yard does almost nothing by itself.
Each tool does one job#
Every hard problem in hosting already has a tool that solves it well. Yard borrows those tools and adds the glue.
Podman runs the containers. Each app runs in a container, so it brings its own Python, Node, or Go, and it cannot step on another app. Podman runs rootless, as a plain user called yard. A process that escapes its container lands in an account that owns nothing else. Podman and containers explains how Yard uses it.
Compose describes each app. An app is a Compose project, the same format you may already use on your laptop. If your repo has a compose.yml, Yard runs it. If it has only a Containerfile, Yard builds it. If it has neither, Yard reads the repo and writes a Containerfile for Stario, Python, Go, Node, or http-nu (a small Nushell web server). What an app runs shows how it decides.
Caddy handles the internet. It holds port 443, gets and renews the TLS certificates on its own, and sends each domain to the right container. Each app has one small site file in Caddy’s own format, and Caddy checks every change before it serves it. Caddy and HTTPS explains the setup.
The forge holds the code. That is GitHub or Cursor Origin, Cursor’s git host. Yard connects to it as an installed app, so it can read private repos and hear about each push. Yard never hosts git. Forges and webhooks explains the connection.
journald keeps the record. Container output, Podman’s events, and Yard’s own events all go to the system journal. A log outlives the container that wrote it. Logs and events shows how to read it.
Yard is the glue. It is one Python program, a Stario app, in a container of its own. It hears the webhooks, decides when to deploy, starts each deploy, writes the site files, and answers the yard command on your laptop.
The picture#
git push │ ┌─────────▼─────────┐ │ GitHub / Origin │ the forge: where the code lives └─────────┬─────────┘ │ webhook: "something moved" ▼ ┌──────────────── one VM ─────────────────────────────┐ │ │ │ :443 ──► Caddy ──┬──► yard-app-1 (Yard) │ │ (TLS) ├──► notes-app-1 (an app) │ │ └──► vault-app-1 (an app) │ │ │ │ containers: rootless Podman, on the network yard │ │ logs and events: journald │ │ state: plain files in /srv/yard │ └─────────────────────────────────────────────────────┘Read it from the top. You push. The forge tells Yard that something moved. Yard does not trust that message: it asks the forge for the new commit itself. Then it builds a new container and swaps it in. Caddy sends traffic to the container by its name, so the swap needs no change to Caddy. A visitor during the swap waits a moment instead of seeing an error.
What one deploy is#
A deploy is four steps you could type yourself: git fetch the commit, podman build an image tagged with it, docker-compose up to swap the container, and start the old image again if the new one never becomes healthy. Podman speaks Docker’s API, so the real docker-compose drives it. One push, start to finish follows a real push through these steps.
What an app promises#
An app has to do four things to live on Yard:
Something Yard can build or pull. That is a
Containerfile, acompose.yml, code in a language Yard knows, or a published image.HTTP on port 8000, on all interfaces. Caddy reaches the app over the network. (A published image may use its own port. Yard reads it from the image.)
Settings from environment variables. You set them with
yard env set.Files that matter in
/data. Everything else in a container goes away at the next deploy./datais a directory on the host, and it stays.
Most apps keep these promises already. Yard never looks inside the image, so a Go binary, a Rails app, or nginx with a static site deploys the same way. Yard grew up next to Stario, so a Stario app needs the least setup: no Containerfile, no settings, nothing to write.
An app does not even need a repo. It can run a public image, or a compose file at a URL, and follow it the way a repo app follows its branch. So Yard is also a plain self-hosting box: a password manager, a status page, and your analytics, next to your own apps, each behind HTTPS. Self-host a service shows how.
What Yard leaves out#
The list of things Yard does not have is part of the design.
No registry. The images Yard builds stay on the VM. An app can run a public image, but Yard never pushes one anywhere.
No CI. The build is the Containerfile. Run your tests wherever you like before you push.
No database. Yard keeps its state in plain files under
/srv/yard, and the record of each deploy on its deploy container. You read the files withcatand the record withpodman inspect.No dashboard. The
yardcommand prints tables, and each table is also JSON from an HTTP API.No cluster. One VM. When it gets full, you get a bigger VM.
One VM is a real limit, and it is the right one for the job. Yard is for people who want ten small apps online for the price of one machine, and who want to understand every moving part.
Why this shape#
A few choices explain most of what follows. You will meet each one again.
Names instead of addresses. Containers come and go. Their names do not. Caddy sends notes.example.com to notes-app-1:8000, a name, so a new container with the same name gets the traffic.
Ask, do not trust. A webhook only means “go look”. Yard reads the new commit from the forge itself. A fake webhook costs one git ls-remote, and a lost one is caught by a timer five minutes later.
Files instead of a database. The state is small and changes rarely. Files read with cat, copy with cp, and never need a migration.
Borrow, do not build. TLS is Caddy’s job. Containers are Podman’s. The app format is Compose. Logs are journald’s. Yard’s job is to connect them and stay small enough to read in an afternoon.
By the way#
The command is
yard. The package on PyPI isstaryard, because somebody else gotyardfirst.Yard deploys itself. The
yardapp is an app like the others, so a push to the Yard repo can upgrade Yard. Inside Yard shows how a program replaces itself without falling over.The source is at github.com/stariodev/yard.