Syntax
Options
Either
--box or --ip is required. If both are provided, the command exits with an error.
The Box Image
The slowest part of an install is obtaining the box’s Docker image. Building it on the box takes roughly 14 minutes — an install always pays the full cost, because the deployment prunes the builder cache before it starts, so there is never a warm layer cache to reuse. Every release tag publishes a pre-built image, andlager install uses it by
default: about 2 minutes instead of 14.
This only applies when --version names a release tag. Branches such as
main and staging have no published image and always build on the box, so
pinning a release tag is the difference between a two-minute install and a
fourteen-minute one.
The image is verified before it is used. It is fetched by immutable digest
rather than by tag, and it must carry a label naming the exact version that was
requested; an image that is unlabelled or claims a different version is
discarded. If anything at all goes wrong — the tag has no published image, the
box cannot reach the registry, the image fails verification — the install
falls back to building on the box, exactly as it always did. A slow install
that works beats a fast one that does not.
Pass --no-pull to skip the pre-built image and always build. Setting
LAGER_BOX_IMAGE_PULL=0 in the environment does the same for every command in
that shell.
What Gets Installed
Installation Flow
- Resolve target - Looks up box IP from
--boxname or uses--ipdirectly - Verify SSH - Tests key-based authentication and settles which identity the rest of the command offers
- Show summary - Displays what will be installed and asks for confirmation
- Deploy - Runs the deployment script. About 2 minutes when the pre-built image is used, or up to 30 minutes when the box builds it (see below)
- Store version - Writes the CLI version to
/etc/lager/versionon the box - Add to config - Optionally adds the box to your local
.lagerconfig
Examples
Passwordless sudo
Installation configures passwordlesssudo for the box login user. The CLI drives
the box over non-interactive SSH, where sudo has no terminal to prompt against,
so the grants have to be in place before provisioning can run.
Lager writes these files, and only these files, under /etc/sudoers.d/:
Each of the three files is regenerated in full on every run — that is what
keeps a box on the current grant shape. A grant added inside one of them is
lost the next time it is written, so each file opens with a header saying so.
Lager never reads, edits, or removes any other file in
/etc/sudoers.d/. If you
or a box-management platform need additional grants, put them in a separate file
there — for example /etc/sudoers.d/zz-local, which sorts after Lager’s files so
its rules win — and Lager will leave it alone, including during lager uninstall.
SSH Authentication
Install requires key-based SSH authentication. It offers~/.ssh/lager_box —
the key lager ssh-setup and lager install generate — explicitly, because
that is not a filename ssh tries on its own. If the box does not accept it,
install falls back to your own default identities, so a box you authorized with
ssh-copy-id works unchanged.
If neither authenticates, install offers to set the key up for you:
--yes accepts it without asking.
Declining stops the install and points you at lager ssh-setup --box <name-or-ip>, which does the same thing as a separate step.
Install does not offer a password fallback for the deployment itself: a box
configured with PasswordAuthentication no never receives the password, so the
resulting “password failed” message described something that had not happened.
For new hosts, the SSH host key is accepted automatically. If the host key has
changed since a previous connection, the command asks you to verify the change
manually before proceeding.
Install does not write to ~/.ssh/config. Earlier versions added a per-IP
Host block naming the key; that block was deleted whenever the file was
regenerated by another tool, and it disabled host-key verification for the box.
The identity is passed per command instead.
Notes
- For a step-by-step walkthrough, see Setting Up a Lager Box
- Requires SSH client tools (
ssh,ssh-keygen) to be installed locally - The deployment script is bundled with the
lager-clipackage - After installation, verify connectivity with
lager hello --box <name> - Use
lager updateto deploy code updates to an already-installed box - Use
lager uninstallto remove Lager software from a box

