Uninstall Elastic Agentedit

To uninstall Elastic Agent from a host, run the uninstall command from the directory where it’s running. Refer to the Fleet and Elastic Agent documentation for more information.

If Agent tamper protection is enabled on the Agent policy for the host, you’ll need to include the uninstall token in the command, using the --uninstall-token flag. You can find the uninstall token on the Agent policy or at FleetUninstall tokens.

For example, to uninstall Elastic Agent on a macOS or Linux host:

sudo elastic-agent uninstall --uninstall-token 12345678901234567890123456789012