Uninstall Elastic Agent

edit

This functionality is in beta and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features.

Uninstall on macOS, Linux, and Windows

edit

To uninstall Elastic Agent, run the uninstall command from the directory where Elastic Agent is running. Not sure where the agent is running? See Installation layout.

You must run this command as the root user.

sudo elastic-agent uninstall

Follow the prompts to confirm that you want to uninstall Elastic Agent. The command stops and uninstalls any managed programs, such as Beats and Elastic Endpoint, before it stops and uninstalls Elastic Agent.

If you run into problems, see Troubleshoot common problems.

Uninstall on DEB or RPM

edit

The uninstall command is not supported for DEB or RPM installations. To uninstall Elastic Agent on DEB or RPM:

  1. If the agent is managed by Fleet, unenroll the agent.
  2. On your host, stop the agent.
  3. Manually remove the agent files from your system.