Set up a host

From a fresh VM to a working Yard in one script and a few commands.

This chapter takes you from an empty VM to a Yard that deploys on push. You run one script on the VM and a handful of commands on your laptop. Plan for about fifteen minutes, most of it spent waiting for packages.

What you need#

  • A VM with Ubuntu 26.04 LTS. Any provider works. Two cores and 4 GB of memory hold a surprising number of small apps.

  • A domain you control. You point a name like yard.example.com at the VM, and later one name per app.

  • Port 443 open, for TCP and UDP. That is the only public port Yard uses, plus SSH for you. Port 80 can stay closed.

  • On your laptop: uv, which brings Python 3.14 for the yard command.

1. Point the DNS at the VM#

Create an A record for yard.example.com with the VM’s address, and an AAAA record if the VM has IPv6. While you are there, add a wildcard record, *.example.com, to the same address. Then every app name points at the VM already, and you are done with DNS for good.

Do this first. Caddy asks for a certificate the moment a name appears in its config, and the request fails while the name does not point at the VM.

2. Run the install script#

SSH into the VM as root and run:

git clone https://github.com/stariodev/yard.git
cd yard
./install.sh --domain yard.example.com

The script asks no questions. It installs Podman and a few helpers, creates the yard user, forwards public port 443 to Caddy, makes the journal persistent, and starts two containers: Yard and Caddy. The host lists every step and the reason for it.

At the end it prints the admin token and the next steps:

token: 3f9a…
caddy: https://yard.example.com -> yard-app-1:8000
url: https://yard.example.com
repo: yard follows https://github.com/stariodev/yard (manual; yard app deploy --app yard upgrades)
local: http://127.0.0.1:8000
 
Next steps:
  yard login --url https://yard.example.com --token <token>
  yard forge setup origin    # or: yard forge setup github
  yard app set --app yard --trigger push   # optional: upgrade Yard on every push to https://github.com/stariodev/yard

Copy the token. If you lose it, it is also in /srv/yard/tokens/admin.token on the VM.

When a step fails, the script stops with the reason and a hint. Fix the cause and run the script again. A second run repairs a half-finished install and leaves a working one alone.

3. Log in from your laptop#

uv tool install staryard
yard login --url https://yard.example.com --token <token>
yard status

yard login saves the address and the token in your user config, so later commands need neither. yard status shows two rows, yard-app-1 and yard-caddy-1. You have a host.

4. Connect a forge#

Yard reads your repos and hears about your pushes as an app installed on your forge. One command sets it up:

yard forge setup github     # or: yard forge setup origin

For GitHub, the browser opens on a filled-in form, and you click once. GitHub sends the key back to the command, and then the install page opens. Install the app on your account and choose “All repositories”. The command notices when the installation lands.

For Cursor Origin, the command prints the values for the form. You create the app, paste its ID, and install it.

Forges and webhooks explains both setups, the flags for organizations and existing apps, and why “All repositories” matters for yard repo new.

Connect a forge even if you only plan to run software that someone else publishes. Every app that deploys from a repo checks through a connected forge, and that includes the yard app itself: without a forge, yard app deploy --app yard cannot upgrade Yard. The repo it follows is public, so connecting GitHub is enough.

5. Check the host#

yard status --full

This runs every host check: Podman, the network, the deploy image, Caddy and its config, the journal, the healthcheck of each app, each forge, and for each host name its DNS, its certificate, and a real HTTPS request. Then the daily prune and the disk. Each line says ok, warn, or FAIL. A line that is not ok says what to do next.

When they are all ok, you are done. From laptop to live puts your first app on the host.

6. Keep Yard up to date (optional)#

Yard is an app on its own host, named yard. The install script pointed it at the repo it came from, with the manual trigger. Like every repo app, it needs the forge from step 4. So an upgrade is one command, whenever you like:

yard app deploy --app yard

Or let each new commit on Yard’s main reach your host by itself, within five minutes:

yard app set --app yard --trigger push

An upgrade is a normal deploy that happens to replace Yard. Your apps keep running, and Yard’s API is gone for a few seconds. The log stream of yard app deploy stops when the old Yard stops, and the command tells you to check yard app status --app yard. A new Yard that never answers goes back to the old image. Inside Yard tells the whole story.

Read the changelog before a big jump. Now and then a release asks you to upgrade through an earlier one first.

Without a domain#

Installed without --domain? Then Yard answers only on the VM, at 127.0.0.1:8000. Reach it through an SSH tunnel, then write Yard’s site file yourself:

ssh -N -L 8000:127.0.0.1:8000 root@yard.example.com &
yard login --url http://127.0.0.1:8000 --token <token>
yard caddy edit --app yard
yard login --url https://yard.example.com --token <token>

By the way#

  • To install from your own fork, run ./install.sh --domain yard.example.com --remote https://github.com/you/yard.git. When your Yard app’s installation covers the fork, each push to it wakes Yard at once.

  • Make a token for each laptop with yard token new laptop, and remove one with yard token rm laptop. A token cannot remove itself. When you remove the admin token, its copy in admin.token goes with it.

  • The script is plain sh and well commented. Read it before you run it as root.