Skip to main content

Deploying and Uninstalling the Liongard Agent

The Liongard Agent runs on Windows, Linux and macOS endpoints and reports back to your Liongard instance. This article explains your deployment options and gives the most basic install command for each platform. For most partners, we recommend the deployment scripts in our public GitHub repository.

The repository holds our current install and uninstall scripts, their settings, exit codes, logs and troubleshooting. If this article and the repository ever differ, follow the repository.

Before you start

You'll need:

  • Your instance prefix, for example us1, us2 or eu1. It's the first part of your Liongard URL (us1.app.liongard.com).

  • An agent install access key: an Access Key ID and Access Key Secret generated in Liongard for agent installs.

  • An environment name (optional). Use the environment's name exactly as it appears in Liongard.

  • Admin rights on the endpoint: an elevated PowerShell or SYSTEM context on Windows, and root on Linux and macOS. RMM and MDM tools usually run scripts this way already.

Treat the access key secret like a password. Store it in your RMM's or MDM's secure variables where you can, and don't paste it into tickets or chat.

Choose a deployment method

If you want to…

Use

Deploy to many endpoints through an RMM or MDM, with logging, checks and safe re-runs

The deployment scripts (recommended)

Install the agent on a single machine by hand, or test a deployment

The basic install commands below

The deployment scripts (recommended)

Each script is one self-contained file. Paste it into your RMM or MDM, fill in the configuration block at the top, and deploy. The scripts:

  • check whether the agent is already installed and healthy, and skip the install if it is

  • repair a broken install, and upgrade an older one where the platform supports it

  • write a log you can read back from your RMM

  • return documented exit codes your RMM can alert on

Platform

Install

Uninstall

Windows

MSI or EXE, each in a Simple and an Advanced version, plus a Clean Install script

Simple (removes the agent from the endpoint) and Advanced (can also remove the agent's record from Liongard)

Linux

LGAgentInstall-Linux.sh

LGAgentUninstall-Linux.sh

macOS

LGAgentInstall-macOS.sh

LGAgentUninstall-macOS.sh

The repository's README has a "Which script do I use?" table. The windows, linux and macos folders each have a README with every setting and RMM or MDM notes.

Download: get the scripts from the latest release. Each release includes a SHA256SUMS file you can use to check your download.

Basic install commands

These are the simplest ways to install the agent by hand. They don't check for an existing agent, repair a broken one, or write a script log. Use them for one-off installs or testing. For anything at scale, use the scripts above.

In each example, replace:

  • us1 with your instance prefix

  • YOUR_ACCESS_KEY_ID and YOUR_ACCESS_KEY_SECRET with your agent install access key

  • Your Environment with your environment name, or remove that setting to install without an environment

Windows (MSI)

Run in an elevated PowerShell window:

$msi = "$env:TEMP\LiongardAgent-lts.msi"
Invoke-WebRequest -Uri "https://agents.static.liongard.com/LiongardAgent-lts.msi" -OutFile $msi -UseBasicParsing

Start-Process msiexec.exe -Wait -ArgumentList @(
'/i', "`"$msi`"",
'LIONGARDURL=us1.app.liongard.com',
'LIONGARDACCESSKEY=YOUR_ACCESS_KEY_ID',
'LIONGARDACCESSSECRET=YOUR_ACCESS_KEY_SECRET',
"LIONGARDAGENTNAME=`"$env:COMPUTERNAME`"",
'LIONGARDENVIRONMENT="Your Environment"',
'/qn', '/norestart'
)
Remove-Item $msi

The MSI accepts these properties:

Property

Required

Value

LIONGARDURL

Yes

Your instance host, for example us1.app.liongard.com

LIONGARDACCESSKEY

Yes

Access Key ID

LIONGARDACCESSSECRET

Yes

Access Key Secret

LIONGARDAGENTNAME

Yes

The agent's name in Liongard; usually the computer name

LIONGARDENVIRONMENT

No

Environment name, exactly as it appears in Liongard

LIONGARDDESCRIPTION

No

A description for the agent

/qn runs the install silently and /norestart prevents a reboot. Exit code 0 means success; 3010 means success with a restart needed.

Linux

Run as root. Use x64 for Intel/AMD machines or arm64 for ARM machines (check with uname -m):

curl -fsSL -o /tmp/LiongardAgent-lts.run https://agents.static.liongard.com/LiongardAgent-lts-x64.xz.run

sh /tmp/LiongardAgent-lts.run --nox11 -- \
-u us1.app.liongard.com \
-k YOUR_ACCESS_KEY_ID \
-s YOUR_ACCESS_KEY_SECRET \
-n "$(hostname)" \
-e "Your Environment"
rm -f /tmp/LiongardAgent-lts.run

Flag

Required

Value

-u

Yes

Your instance host, for example us1.app.liongard.com

-k

Yes

Access Key ID

-s

Yes

Access Key Secret

-n

Yes

The agent's name in Liongard; usually the hostname

-e

No

Environment name

-d

No

A description for the agent

--nox11 keeps the installer from opening a terminal window on machines with a desktop. The -- separates the installer's own options from the agent settings.

macOS

The macOS package reads its settings from files in /tmp, so you write those first and remove them afterward. Run as root (for example, sudo -i). Use LiongardAgent-lts.pkg on Intel Macs or LiongardAgent-lts-arm64.pkg on Apple Silicon (check with uname -m: x86_64 or arm64):

umask 077
printf '%s' 'us1.app.liongard.com' > /tmp/liongard_instance_url
printf '%s' 'YOUR_ACCESS_KEY_ID' > /tmp/liongard_access_key_id
printf '%s' 'YOUR_ACCESS_KEY_SECRET' > /tmp/liongard_access_key_secret
printf '%s' "$(scutil --get ComputerName)" > /tmp/liongard_name
printf '%s' 'Your Environment' > /tmp/liongard_environment
curl -fsSL -o /tmp/LiongardAgent-lts.pkg https://agents.static.liongard.com/LiongardAgent-lts-arm64.pkg
installer -pkg /tmp/LiongardAgent-lts.pkg -target /
rm -f /tmp/LiongardAgent-lts.pkg /tmp/liongard_instance_url /tmp/liongard_access_key_id \
/tmp/liongard_access_key_secret /tmp/liongard_name /tmp/liongard_environment

To install without an environment, leave out the liongard_environment line. umask 077 makes the settings files readable by root only, and the last command removes them once the install finishes.

If you deploy through an MDM such as Jamf Pro or Intune, use LGAgentInstall-macOS.sh from the repository instead. It handles these files safely and checks the agent afterward.

Uninstalling the agent

Uninstalling has two parts:

  1. Remove the agent from the endpoint.

  2. Remove the agent's record from Liongard, if you no longer want it listed.

The uninstall scripts handle step 1 on every platform. On Windows, the Uninstall Advanced script can also handle step 2. It removes a record only when exactly one agent in the same environment matches the machine's hostname. In every other case, remove the agent's record in Liongard yourself.

To remove the agent by hand:

  • Windows: uninstall Liongard Agent from Settings > Apps (or Programs and Features).

  • macOS: run sudo /Library/Liongard/uninstall.sh.

  • Linux: use LGAgentUninstall-Linux.sh. It finds the agent's uninstaller, stops the service and removes what's left.

A manual uninstall can leave files or services behind. The uninstall scripts clean these up as well.

Getting help

  • Script settings, exit codes and logs: see the README in the repository's windows, linux or macos folder.

  • Questions or problems: contact Liongard Support. Include the script name, the exit code and the script's log.

  • Security issues: report them privately to security.ops@liongard.com.

Did this answer your question?