- Fleet and Elastic Agent Guide: other versions:
- Fleet and Elastic Agent overview
- Beats and Elastic Agent capabilities
- Quick starts
- Migrate from Beats to Elastic Agent
- Deployment models
- Install Elastic Agents
- Install Fleet-managed Elastic Agents
- Install standalone Elastic Agents
- Install Elastic Agents in a containerized environment
- Run Elastic Agent in a container
- Run Elastic Agent on Kubernetes managed by Fleet
- Install Elastic Agent on Kubernetes using Helm
- Example: Install standalone Elastic Agent on Kubernetes using Helm
- Example: Install Fleet-managed Elastic Agent on Kubernetes using Helm
- Advanced Elastic Agent configuration managed by Fleet
- Configuring Kubernetes metadata enrichment on Elastic Agent
- Run Elastic Agent on GKE managed by Fleet
- Run Elastic Agent on Amazon EKS managed by Fleet
- Run Elastic Agent on Azure AKS managed by Fleet
- Run Elastic Agent Standalone on Kubernetes
- Scaling Elastic Agent on Kubernetes
- Using a custom ingest pipeline with the Kubernetes Integration
- Environment variables
- Run Elastic Agent as an OTel Collector
- Run Elastic Agent without administrative privileges
- Install Elastic Agent from an MSI package
- Installation layout
- Air-gapped environments
- Using a proxy server with Elastic Agent and Fleet
- Uninstall Elastic Agents from edge hosts
- Start and stop Elastic Agents on edge hosts
- Elastic Agent configuration encryption
- Secure connections
- Manage Elastic Agents in Fleet
- Configure standalone Elastic Agents
- Create a standalone Elastic Agent policy
- Structure of a config file
- Inputs
- Providers
- Outputs
- SSL/TLS
- Logging
- Feature flags
- Agent download
- Config file examples
- Grant standalone Elastic Agents access to Elasticsearch
- Example: Use standalone Elastic Agent with Elastic Cloud Serverless to monitor nginx
- Example: Use standalone Elastic Agent with Elasticsearch Service to monitor nginx
- Debug standalone Elastic Agents
- Kubernetes autodiscovery with Elastic Agent
- Monitoring
- Reference YAML
- Manage integrations
- Package signatures
- Add an integration to an Elastic Agent policy
- View integration policies
- Edit or delete an integration policy
- Install and uninstall integration assets
- View integration assets
- Set integration-level outputs
- Upgrade an integration
- Managed integrations content
- Best practices for integration assets
- Data streams
- Define processors
- Processor syntax
- add_cloud_metadata
- add_cloudfoundry_metadata
- add_docker_metadata
- add_fields
- add_host_metadata
- add_id
- add_kubernetes_metadata
- add_labels
- add_locale
- add_network_direction
- add_nomad_metadata
- add_observer_metadata
- add_process_metadata
- add_tags
- community_id
- convert
- copy_fields
- decode_base64_field
- decode_cef
- decode_csv_fields
- decode_duration
- decode_json_fields
- decode_xml
- decode_xml_wineventlog
- decompress_gzip_field
- detect_mime_type
- dissect
- dns
- drop_event
- drop_fields
- extract_array
- fingerprint
- include_fields
- move_fields
- parse_aws_vpc_flow_log
- rate_limit
- registered_domain
- rename
- replace
- script
- syslog
- timestamp
- translate_sid
- truncate_fields
- urldecode
- Command reference
- Troubleshoot
- Release notes
Uninstall Elastic Agents from edge hosts
editUninstall Elastic Agents from edge hosts
editUninstall on macOS, Linux, and Windows
editTo uninstall Elastic Agent, run the uninstall
command from the directory where
Elastic Agent is running.
Be sure to run the uninstall
command from a directory outside of where Elastic Agent is installed.
For example, on a Windows system the install location is C:\Program Files\Elastic\Agent
. Run the uninstall command from C:\Program Files\Elastic
or \tmp
, or even your default home directory:
C:\"Program Files"\Elastic\Agent\elastic-agent.exe uninstall
You must run this command as the root user.
sudo /Library/Elastic/Agent/elastic-agent uninstall
You must run this command as the root user.
sudo /opt/Elastic/Agent/elastic-agent uninstall
Open a PowerShell prompt as an Administrator (right-click the PowerShell icon and select Run As Administrator).
From the PowerShell prompt, 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, refer to Troubleshoot common problems.
If you are using DEB or RPM, you can use the package manager to remove the installed package.
For hosts enrolled in the Elastic Defend integration with Agent tamper protection enabled, you’ll need to include the uninstall token in the command, using the --uninstall-token
flag. Refer to the Agent tamper protection docs for more information.
Remove Elastic Agent files manually
editYou might need to remove Elastic Agent files manually if there’s a failure during installation.
To remove Elastic Agent manually from your system:
- Unenroll the agent if it’s managed by Fleet.
- For standalone agents, back up any configuration files you want to preserve.
-
On your host, stop the agent. If any Elastic Agent-related processes are still running, stop them too.
Search for these processes and stop them if they’re still running:
filebeat
,metricbeat
,fleet-server
, andelastic-endpoint
. -
Manually remove the Elastic Agent files from your system. For example, if you’re
running Elastic Agent on macOS, delete
/Library/Elastic/Agent/*
. Not sure where the files are installed? Refer to Installation layout. -
If you’ve configured the Elastic Defend integration, also remove the files installed for endpoint protection. The directory structure is similar to Elastic Agent, for example,
/Library/Elastic/Endpoint/*
.When you remove the Elastic Defend integration from a macOS host (10.13, 10.14, or 10.15), the Endpoint System Extension is left on disk intentionally. If you want to remove the extension, refer to the documentation for your operating system.