Uninstall Elastic Agent
editUninstall Elastic Agent
editThis 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
editTo 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
You must run this command as the root user.
sudo elastic-agent uninstall
Open a PowerShell prompt as an Administrator (right-click the PowerShell icon and select Run As Administrator).
From the PowerShell prompt, change to the directory where Elastic Agent is installed, and run:
C:\Program Files\Elastic\Agent\elastic-agent.exe 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
editThe uninstall
command is not supported for DEB or RPM installations. To
uninstall Elastic Agent on DEB or RPM:
- If the agent is managed by Fleet, unenroll the agent.
- On your host, stop the agent.
- Manually remove the agent files from your system.