Skip to main content
Deploy the Lager box software, Docker container, and supporting tools onto a new or existing box.

Syntax

Options

Either --box or --ip is required. If both are provided, the command exits with an error.

What Gets Installed

Installation Flow

  1. Resolve target - Looks up box IP from --box name or uses --ip directly
  2. Verify SSH - Tests key-based authentication and settles which identity the rest of the command offers
  3. Show summary - Displays what will be installed and asks for confirmation
  4. Deploy - Runs the deployment script (up to 30 minutes for a fresh install)
  5. Store version - Writes the CLI version to /etc/lager/version on the box
  6. Add to config - Optionally adds the box to your local .lager config

Examples

Passwordless sudo

Installation configures passwordless sudo 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/:
The box login user is root-equivalent by design. Provisioning a box requires root — deploying udev rules runs commands as root by construction, and apt-get executes arbitrary commands as root through its own configuration. The grants above are written as specific commands to keep the blast radius small and the file readable, but they are not a privilege boundary: anyone who can log in as the box user can obtain root on that box.Treat the box login account as equivalent to root when deciding who holds its SSH key, and prefer a dedicated user on a dedicated machine.
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 stops and tells you to run:
That prompts for the box password once, installs the key, and every later step of the install runs unattended. Install does not offer a password fallback of its own: 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

  • Requires SSH client tools (ssh, ssh-keygen) to be installed locally
  • The deployment script is bundled with the lager-cli package
  • After installation, verify connectivity with lager hello --box <name>
  • Use lager update to deploy code updates to an already-installed box
  • Use lager uninstall to remove Lager software from a box