Install Elastic Agent from an MSI package
editInstall Elastic Agent from an MSI package
editMSI is the file format and command line utility for the Windows Installer. Windows Installer (previously known as Microsoft Installer) is an interface for Microsoft Windows that’s used to install and manage software on Windows systems. This section covers installing Elastic Agent through the MSI package repository.
The MSI package installer must be run by an administrator account. The installer won’t start without Windows admin permissions.
Install Elastic Agent
edit- Download the latest Elastic Agent MSI binary from the Elastic Agent download page.
-
Run the installer:
elastic-agent-<VERSION>-windows-x86_64.msi INSTALLARGS="--url=<URL> --enrollment-token=<TOKEN>"
Where:
-
VERSIONis the Elastic Stack version you’re installing, indicated in the MSI package name. For example,8.13.2. -
URLis the Fleet Server URL used to enroll the Elastic Agent into Fleet. You can find this on the Fleet Settings tab in Kibana. -
TOKENis the authentication token used to enroll the Elastic Agent into Fleet. You can find this on the Fleet Enrollment tokens tab.
When you run the command, the value set for
INSTALLARGSwill be passed to theelastic-agent installcommand verbatim. -
-
If you need to troubleshoot, you can install using
msiexecwith the-L*V "log.txt"option to create installation logs:msiexec -i elastic-agent-<VERSION>-windows-x86_64.msi INSTALLARGS="--url=<URL> --enrollment-token=<TOKEN>" -L*V "log.txt"
Installation notes
editInstalling using an MSI package has the following behaviors:
-
If
INSTALLARGSare not provided, the MSI will copy the files to a temporary folder and finish. -
If
INSTALLARGSare provided, the MSI will copy the files to a temporary folder and then run theelastic-agent installcommand with the provided parameters. If the install flow is successful, the temporary folder is deleted. -
If
INSTALLARGSare provided but theelastic-agent installcommand fails, the top-level folder is NOT deleted, in order to allow for further troubleshooting. -
If the
elastic-agent installcommand fails for any reason, the MSI will rollback all changes. -
If the Elastic Agent enrollment fails, the install will fail as well. To avoid this behavior you can add the
--delay-enrolloption to the install command.
Upgrading
editThe Elastic Agent version can be upgraded via Fleet, but the registered MSI version will display the initially installed version. Attempts to upgrade outside of Fleet via the MSI will require an uninstall and reinstall procedure to upgrade.
Installing in a custom location
editStarting in version 8.13, it’s also possible to override the default installation folder by running the MSI from the command line, as shown:
elastic-agent-<VERSION>-windows-x86_64.msi INSTALLARGS="--url=<URL> --enrollment-token=<TOKEN>" INSTALLDIR="<path of custom folder>"