Skip to main content
Remove the Lager box software, Docker containers, and supporting files from a gateway.

Syntax

lager uninstall [OPTIONS]

Options

OptionTypeDefaultDescription
--box TEXTstringBox name (uses stored IP and username from .lager config)
--ip TEXTstringTarget box IP address
--user TEXTstringlagerdataSSH username
--keep-configflagPreserve /etc/lager directory (saved nets, box ID, etc.)
--keep-docker-imagesflagRemove containers only, keep Docker images
--allflagRemove everything including udev rules, sudoers, third-party tools, and deploy key
--yesflagSkip confirmation prompts
--helpShow help message and exit
Either --box or --ip is required.

What Gets Removed

Default Removal

ComponentDescription
Docker containersStops and removes the lager container
Docker imagesRemoves images and build cache (unless --keep-docker-images)
~/box directoryBox code and services
/etc/lager directorySaved nets, box ID, version (unless --keep-config)

With --all

In addition to the above:
ComponentDescription
Udev rules/etc/udev/rules.d/lager-*.rules
Sudoers config/etc/sudoers.d/lagerdata-udev
~/third_partyJ-Link, custom binaries
Deploy key~/.ssh/lager_deploy_key* and SSH config entry

Examples

# Basic uninstall
lager uninstall --ip 192.168.1.100

# Uninstall but keep saved nets
lager uninstall --ip 192.168.1.100 --keep-config

# Uninstall but keep Docker images for faster reinstall
lager uninstall --ip 192.168.1.100 --keep-docker-images

# Complete cleanup
lager uninstall --ip 192.168.1.100 --all

# Non-interactive uninstall of a stored box
lager uninstall --box my-box --yes

Uninstall Flow

  1. Resolve target - Looks up box IP from --box name or uses --ip directly
  2. Verify SSH - Tests key-based authentication, falls back to password if needed
  3. Show summary - Lists what will be removed based on flags
  4. Confirm - Requires explicit confirmation (unless --yes)
  5. Remove step by step:
    • Stop and remove Docker containers
    • Clean Docker images and build cache
    • Remove ~/box directory
    • Remove /etc/lager directory
    • Remove additional components (if --all)
  6. Report - Confirms completion and suggests --all if not used

Notes

  • Each removal step continues even if a previous step fails, so partial uninstalls are possible
  • Use --keep-config if you plan to reinstall and want to preserve your net configuration
  • Use --keep-docker-images for a faster reinstall since images won’t need to be rebuilt
  • After uninstalling, use lager install to redeploy