Run 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.

Elastic Agent runs in two modes: standalone or fleet. The two modes differ in how you configure and manage the agent.

Run in Fleet mode

edit

With fleet mode, you manage Elastic Agent remotely. The agent uses a trusted Kibana instance to retrieve configurations and report agent events. This trusted Kibana instance must have Ingest Manager and Fleet enabled.

To create a trusted communication channel between Elastic Agent and Kibana, enroll the agent to Fleet.

To enroll an Elastic Agent to Fleet:

  1. Stop Elastic Agent, if it’s already running.
  2. In Ingest Manager, click Settings and change the defaults, if necessary. For self-managed installations, set the URLs for Elasticsearch and Kibana, including the http ports, then save your changes.

    Ingest Manager settings
  3. Select Fleet, then click Add agent to get an enrollment token. See Quick start for detailed steps.
  4. Change to the directory where Elastic Agent is installed, and enroll the agent to Fleet:

    We recommend that you run this command as the root user because some integrations require root privileges to collect sensitive data.

    elastic-agent enroll KIBANA_URL ENROLLMENT_KEY

    Where KIBANA_URL is the Kibana URL where Fleet is running, and ENROLLMENT_KEY is the enrollment token acquired from Fleet.

  5. Run the agent:

    The DEB package includes a service unit for Linux systems with systemd. On these systems, you can manage Elastic Agent by using the usual systemd commands:

    systemctl enable elastic-agent
    systemctl start elastic-agent

    Otherwise, use:

    sudo service elastic-agent start

    Elastic Agent will restart automatically if the system is rebooted.

Run in standalone mode (default)

edit

With standalone mode, you manually configure and manage Elastic Agent locally on the system where the agent is installed. Elastic Agent is configured to run in standalone mode by default unless you enroll it in Fleet.

If Elastic Agent is installed as an auto-starting service, it will run automatically when you restart your system.

To start Elastic Agent manually, run:

The DEB package includes a service unit for Linux systems with systemd. On these systems, you can manage Elastic Agent by using the usual systemd commands:

systemctl enable elastic-agent
systemctl start elastic-agent

Otherwise, use:

sudo service elastic-agent start

Elastic Agent will restart automatically if the system is rebooted.

Use the -c flag to specify the configuration file. If no configuration file is specified, Elastic Agent uses the default configuration, elastic-agent.yml, which is located in the same directory as Elastic Agent.

For configuration options, see Configuration settings.