From laptop to live

One app, one folder, one command, and then it is on the internet.

This chapter is the whole trip. We make a small app, put it in a repo, and hand it to Yard. Then we change it, give it a setting, break it on purpose, and fix it. At the end, the app runs at https://hello.example.com, and you have written no Dockerfile, no pipeline file, and no server configuration.

You can read this chapter before you have a host. It shows the shape of the work, and the later chapters explain each part. To follow along for real, you need four things from Set up a host:

  • A Yard host, installed with --domain.

  • A wildcard DNS record, such as *.example.com, that points at the VM.

  • The yard command on your laptop, after yard login.

  • A forge connected, with the Yard app installed on “All repositories”.

Want to run software that someone else wrote, such as a password manager? That needs no repo and no code. Self-host a service is your chapter.

1. An app on your laptop#

Start with a new Stario app:

uvx stario-create new hello
cd hello
just dev

Open http://127.0.0.1:8000, and the page says hello. That folder is all Yard needs. Four of its files matter more than the rest:

hello/
  pyproject.toml   lists stario as a dependency
  uv.lock          the exact version of every package
  app/main.py      the entry point: python -m app.main
  app/config.py    every setting, and where files go: $PROJECT_DATA_DIR, or ./data

Any app can go on Yard. We start with Stario because Yard knows it best. Other languages at the end shows a Go, a Node, a Python, and an http-nu app.

2. A repo#

Yard deploys from a repo on GitHub or Cursor Origin. Commit the files, then let Yard create the repo:

git add -A
git commit -m "First version"
yard repo new

The repo is private. It is created on the account where your Yard app is installed, and --owner picks one when there are several. Yard then pushes with your own git credentials, exactly as a git push you type would.

yard repo new needs the Yard app installed on “All repositories”. An installation on selected repositories cannot see a repo that did not exist when you selected them, so the command stops and says so. Forges and webhooks explains why, and how a second account keeps your other repos out of it.

Already have a repo? Skip this step. Yard only needs the origin remote of your checkout.

3. One command#

Still in the app’s folder, run:

yard app new --caddy hello.example.com

The name hello.example.com must already point at the VM. The wildcard record from Set up a host does that for every name at once.

Yard reads the repo URL and the branch from your checkout, so there is nothing else to type. The app takes its name from the repo: github.com/you/hello becomes hello. Yard creates the app, deploys it at once, and streams the deploy while it works:

name  hello
repo  https://github.com/you/hello
ref  main
trigger  push
created  2026-11-06T15:00:00Z
runs  auto (not deployed yet)
Deploying hello now…
== sync https://github.com/you/hello main
== runs yard:python-uv (containerfile; stario: pyproject.toml declares stario)
== build localhost/hello:4f1c2a9b7d3e-88dff6cd
…
built 2026-11-06T15:01:12Z
== start localhost/hello:4f1c2a9b7d3e-88dff6cd
== started localhost/hello:4f1c2a9b7d3e-88dff6cd
ok  localhost/hello:4f1c2a9b7d3e-88dff6cd
Saved. Caddy serves hello.example.com for hello.

Give Caddy a few seconds to get the certificate. Then open https://hello.example.com. The page that said hello on your laptop now says hello on the internet.

Ctrl-C during the stream stops only the stream. The deploy keeps running on the host, and yard app logs --deploy -f picks it up again.

4. What Yard just did#

Read the == runs line again, because it is the interesting one. The repo has no Dockerfile, so Yard looked at the files instead. It saw stario in pyproject.toml and knew what kind of app this is. Then it wrote a Containerfile from its yard:python-uv template and built it:

  • The image installs the packages exactly as uv.lock lists them, with uv sync --locked.

  • The image starts the app the way you do: python -m app.main.

  • The container gets STARIO_HOST=0.0.0.0 and STARIO_PORT=8000, so Caddy can reach the app.

  • The container gets STARIO_TRACER=json, so each request becomes one JSON line in the log.

  • The container gets /data, a directory on the host that survives every deploy.

The image tag says what is inside it. 4f1c2a9b7d3e is your commit. 88dff6cd is the stamp of Yard’s templates: a short hash that changes when a Yard release changes a template, so the new template builds a new image. Nothing is hidden. To read the file Yard wrote, run:

yard app cat containerfile

yard status now shows the app next to Yard itself:

name          state    cpu   mem   data  rev      host                deploy
yard-app-1    up 6h  0.10%  60MB  128MB  9c2c7e1  yard.example.com    ok 43s · 2h
yard-caddy-1  up 6h  0.30%  24MB  128MB                               ok 43s · 2h
hello-app-1   up 1m  0.40%  48MB         4f1c2a9  hello.example.com   ok 38s · 1m

One row per container. rev is the commit it runs. deploy says how the last deploy went, how long it took, and how long ago it ran.

And the container name, hello-app-1? Compose builds it from the project (hello), the service (app), and a counter (1). You will see the <name>-app-1 pattern all over Yard. It is the name that Caddy dials.

5. A change#

Change the sentence on the home page and push:

git commit -am "Say something new"
git push

That is the whole deploy. The forge tells Yard about the push. Yard fetches the commit, builds it, and swaps the container. Caddy keeps sending visitors to the same container name, and it holds a request for up to ten seconds while the new container starts. So nobody sees an error during the swap. Run yard app logs --deploy -f if you want to watch.

6. A setting#

The app reads its name from the APP_NAME environment variable (see app/config.py). Set it on the host:

yard env set APP_NAME="Hello from Yard"
Saved. hello keeps its old settings until the next deploy.
Apply now: yard app deploy --app hello

Saving never restarts the app. You choose when the change lands. Run the line it printed:

yard app deploy
Deploying hello now…
== sync https://github.com/you/hello main
== runs yard:python-uv (containerfile; stario: pyproject.toml declares stario)
== reuse localhost/hello:4f1c2a9b7d3e-88dff6cd
== start localhost/hello:4f1c2a9b7d3e-88dff6cd
== started localhost/hello:4f1c2a9b7d3e-88dff6cd
ok  localhost/hello:4f1c2a9b7d3e-88dff6cd

Look for == reuse. The code did not change, so there is no build. Compose starts a new container from the same image with the new value, and the page title changes.

One setting you never make is where the data goes. A container is thrown away at each deploy, so a file inside it is lost. But app/config.py keeps every file in PROJECT_DATA_DIR, and Yard sets that to /data. On the host, that is /srv/yard/apps/hello/data, and it outlives every container. When the app gets a database, its file goes there too. On your laptop, the same code writes to ./data, which git ignores.

Secrets go the same way as APP_NAME, and never into the repo. Settings and data has the whole story of the env file and /data.

7. A mistake#

Now break something on purpose. Add a package, but commit only half of the change:

uv add httpx
git commit -m "Add httpx" pyproject.toml
git push

The new pyproject.toml asks for httpx, but the old uv.lock does not list it. The build stops. yard status shows the failed deploy, and yard app logs --deploy shows why:

error: The lockfile at `uv.lock` needs to be updated, but `--locked` was provided.

The live site does not notice. The build failed before anything started, so the old container keeps running. Yard also does not try that commit again: a failed commit stays failed, and the next one gets a fresh try. Commit the lock and push again:

git commit -m "Lock httpx" uv.lock
git push

That is how Yard meets every mistake:

  • A build that fails never starts. The old container keeps running.

  • A container that starts but never becomes healthy is replaced by the previous image.

  • A repo that Yard cannot read stops before the build, with a message that says what Yard found and what to add. When Yard refuses lists each message.

The second rule needs a healthcheck. Without one, “healthy” only means “running”, and a container that runs but answers nothing goes live. That is the next step.

8. Your own Containerfile#

The file Yard wrote is a good start. When you want more, take it into the repo and change it. The first change worth making is a healthcheck:

yard app cat containerfile > Containerfile

Add one line at the end:

HEALTHCHECK --interval=10s --timeout=3s --start-period=30s \
  CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/')"

Then tell Yard to build this file, and push:

git add Containerfile
git commit -m "Own the Containerfile"
yard app set --runs Containerfile
git push

Set --runs before you push. Yard notices when a commit changes what the repo runs, here from its own file to yours, and it refuses to switch on its own. Auto decides on every deploy explains that guard. Healthchecks explains the numbers in the line.

When it does not work#

Three commands answer almost every question about a first deploy:

yard app logs --deploy    # the build and the start: did the deploy work?
yard app logs             # the app's own output: did the app start?
yard status --full        # the host: DNS, the certificate, Caddy

The usual causes, most likely first:

  • Yard could not tell what to build. The deploy stops before the build with a !! line. When Yard refuses lists each message and its fix.

  • The build failed. The deploy log shows the build output. Fix it and push.

  • The app listens on 127.0.0.1. Inside a container, that address means “only me”, so Caddy cannot reach it. Listen on 0.0.0.0.

  • The app listens on another port. Use 8000, or change the port in the site file with yard caddy edit.

  • The name does not point at the VM yet. yard status --full shows a dns, a certificate, and an https row for each host.

Without a healthcheck, the two listening mistakes look fine in yard status: the container runs, so it says up. The browser shows a 502 from Caddy. With a healthcheck, the deploy catches the mistake and keeps the old version.

What you did not do#

Look back over the steps. You did not write a Dockerfile, a CI pipeline, or a Caddy or nginx config. You did not buy a certificate, set up a registry, open a firewall port, or log in to the server. Yard did each of those jobs, and each one left a record that you can read:

  • yard app cat containerfile prints the file that built the image.

  • yard app logs --deploy prints the deploy, step by step.

  • yard caddy cat prints the site file that serves the app.

  • yard events --app hello lists every push, check, deploy, and setting change.

Other languages#

Yard reads more than Stario. The steps are the same four: commit, push, yard app new, and open the address. Only the files differ, and so does the == runs line.

A Go service needs a go.mod and one package main, at the root or in cmd/:

api/
  go.mod     go 1.26
  main.go    package main
 
== runs yard:go (containerfile; go: go.mod)

Yard builds one static binary and runs it on a distroless image.

A Node app needs a package.json with a start script:

shop/
  package.json        "build": "vite build", "start": "node server.js"
  package-lock.json
 
== runs yard:node-npm (containerfile; node: package.json start script)

Yard runs npm ci, then npm run build because there is a build script, and starts with npm start.

A plain Python app needs uv.lock or requirements.txt, and an entry point such as app.py:

notes/
  requirements.txt   flask
  app.py
 
== runs yard:python-pip (containerfile; python: requirements.txt)

A cross.stream app needs only serve.nu:

board/
  serve.nu   {|req| ... }
 
== runs yard:http-nu (containerfile; http-nu: serve.nu)

Stario and http-nu listen on the right address without help. A Go, Node, or plain Python app must listen on 0.0.0.0, on the port in the PORT variable, which Yard sets to 8000. Flask’s app.run() listens on 127.0.0.1:5000 by default, so it needs host="0.0.0.0" and the port.

Anything else, such as Rust, Ruby, or a static site, brings its own Dockerfile:

api/
  Dockerfile   FROM rust:1-slim …
  Cargo.toml
  src/main.rs
 
== runs Dockerfile (containerfile; found Dockerfile)

Yard builds it as it is.

Where to go next#

By the way#

  • A branch can be an app too. That gives you a preview of a branch in one command. Day to day shows how.

  • Settings before the first start. yard app new takes -e KEY=VALUE, --env-file PATH, and --edit-env, so a secret is in place before the first deploy. Settings and data shows each one.

  • Not in a checkout? yard app new --repo https://github.com/you/hello --ref main does the same thing from anywhere.