Syntax
Options
Either
--box or --ip is required.
What Gets Removed
Default Removal
Configuration
/etc/lager is kept by default: saved nets, box config, SSH key registrations, and the files of a control plane that manages the box. A reinstall picks all of it up again.
--purge-config first copies /etc/lager to ~/lager-backup-<timestamp>/ on the box. The backup holds etc-lager.tgz (mode 600) and saved_nets.json. The command then prints how many saved nets it will delete, and deletes the contents of /etc/lager. If the backup fails, nothing is deleted. Every purge keeps:
--purge-config --include-control-plane also deletes the control plane’s files and the no_publish marker, keeping only the key registrations. A gateway in front of lager then refuses every connection until the box is re-linked from its control plane.
To restore the saved nets after a reinstall, run this on the box:
With --all
In addition to the above:
--all revokes this machine’s lager_box key only where lager put it. A copy elsewhere in authorized_keys stays: ssh-copy-id, a person, or another key manager put it there. A key that another registration still holds also stays. So a key that several machines share keeps working for the others.
Uninstall removes those three sudoers files by name. Lager never touches any
other file under
/etc/sudoers.d/. A grant that you or your management platform
added in a separate file there is left alone. That holds both for uninstall and
for the installs and updates that regenerate Lager’s own files.Examples
Uninstall Flow
- Resolve target - Looks up box IP from
--boxname or uses--ipdirectly - Verify SSH - Offers
~/.ssh/lager_box, then your own default identities, and falls back to password if neither authenticates - Show summary - Lists what will be removed based on flags
- Confirm - Requires explicit confirmation (unless
--yes) - Remove step by step:
- Stop and remove Docker containers, and stop the SSH key-sync poller
- Clean Docker images and build cache
- Remove
~/boxdirectory - Clear the lock state, or back up and purge
/etc/lager(with--purge-config) - Remove additional components (if
--all)
- Report - Confirms completion and suggests
--allif not used
Notes
- Each removal step continues even if a previous step fails, so partial uninstalls are possible
- Use
--dry-runto see what happens to/etc/lagerunder the flags you pass, including the saved-net count - Use
--keep-docker-imagesfor a faster reinstall since images won’t need to be rebuilt - After uninstalling, use
lager installto redeploy

