Syntax
Options
| Option | Type | Default | Description |
|---|---|---|---|
--box TEXT | string | Box name (uses stored IP and username from .lager config) | |
--ip TEXT | string | Target box IP address | |
--user TEXT | string | lagerdata | SSH username |
--keep-config | flag | Preserve /etc/lager directory (saved nets, box ID, etc.) | |
--keep-docker-images | flag | Remove containers only, keep Docker images | |
--all | flag | Remove everything including udev rules, sudoers, third-party tools, and deploy key | |
--yes | flag | Skip confirmation prompts | |
--help | Show help message and exit |
--box or --ip is required.
What Gets Removed
Default Removal
| Component | Description |
|---|---|
| Docker containers | Stops and removes the lager container |
| Docker images | Removes images and build cache (unless --keep-docker-images) |
~/box directory | Box code and services |
/etc/lager directory | Saved nets, box ID, version (unless --keep-config) |
With --all
In addition to the above:
| Component | Description |
|---|---|
| Udev rules | /etc/udev/rules.d/lager-*.rules |
| Sudoers config | /etc/sudoers.d/lagerdata-udev |
~/third_party | J-Link, custom binaries |
| Deploy key | ~/.ssh/lager_deploy_key* and SSH config entry |
Examples
Uninstall Flow
- Resolve target - Looks up box IP from
--boxname or uses--ipdirectly - Verify SSH - Tests key-based authentication, falls back to password if needed
- 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
- Clean Docker images and build cache
- Remove
~/boxdirectory - Remove
/etc/lagerdirectory - 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
--keep-configif you plan to reinstall and want to preserve your net configuration - Use
--keep-docker-imagesfor a faster reinstall since images won’t need to be rebuilt - After uninstalling, use
lager installto redeploy

