Skip to content

Latest commit

 

History

History
175 lines (121 loc) · 7.34 KB

install-standalone-elastic-agent.md

File metadata and controls

175 lines (121 loc) · 7.34 KB
mapped_pages

Install standalone Elastic Agents [install-standalone-elastic-agent]

To run an {{agent}} in standalone mode, install the agent and manually configure the agent locally on the system where it’s installed. You are responsible for managing and upgrading the agents. This approach is recommended for advanced users only.

We recommend using {{fleet}}-managed {{agent}}s, when possible, because it makes the management and upgrade of your agents considerably easier.

::::{important} Standalone agents are unable to upgrade to new integration package versions automatically. When you upgrade the integration in {{kib}}, you’ll need to update the standalone policy manually. ::::

::::{note} You can install only a single {{agent}} per host. ::::

{{agent}} can monitor the host where it’s deployed, and it can collect and forward data from remote services and hardware where direct deployment is not possible.

To install and run {{agent}} standalone:

  1. On your host, download and extract the installation package.

    ::::{tab-set}

    :::{tab-item} macOS

    curl -L -O https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent-{{stack-version}}-darwin-x86_64.tar.gz
    tar xzvf elastic-agent-{{stack-version}}-darwin-x86_64.tar.gz

    :::

    :::{tab-item} Linux

    curl -L -O https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent-{{stack-version}}-linux-x86_64.tar.gz
    tar xzvf elastic-agent-{{stack-version}}-linux-x86_64.tar.gz

    :::

    :::{tab-item} Windows

    # PowerShell 5.0+
    wget https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent-{{stack-version}}-windows-x86_64.zip -OutFile elastic-agent-{{stack-version}}-windows-x86_64.zip
    Expand-Archive .\elastic-agent-{{stack-version}}-windows-x86_64.zip

    Or manually:

    1. Download the {{agent}} Windows zip file from the download page.

    2. Extract the contents of the zip file. :::

    :::{tab-item} DEB IMPORTANT:

    • To simplify upgrading to future versions of {{agent}}, we recommended that you use the tarball distribution instead of the DEB distribution.
    • You can install {{agent}} in an unprivileged mode that does not require root privileges. Refer to Run {{agent}} without administrative privileges for details.
    curl -L -O https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent-{{stack-version}}-amd64.deb
    sudo dpkg -i elastic-agent-{{stack-version}}-amd64.deb

    :::

    :::{tab-item} RPM IMPORTANT:

    • To simplify upgrading to future versions of {{agent}}, we recommended that you use the tarball distribution instead of the RPM distribution.
    • You can install {{agent}} in an unprivileged mode that does not require root privileges. Refer to Run {{agent}} without administrative privileges for details.
    curl -L -O https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent-{{stack-version}}-x86_64.rpm
    sudo rpm -vi elastic-agent-{{stack-version}}-x86_64.rpm

    :::

    ::::

    The commands shown are for AMD platforms, but ARM packages are also available. Refer to the {{agent}} downloads page for the full list of available packages.

  2. Modify settings in the elastic-agent.yml as required.

    To get started quickly and avoid errors, use {{kib}} to create and download a standalone configuration file rather than trying to build it by hand. For more information, refer to Create a standalone {{agent}} policy.

    For additional configuration options, refer to Configure standalone {{agent}}s.

  3. In the elastic-agent.yml policy file, under outputs, specify an API key or user credentials for the {{agent}} to access {{es}}. For example:

    [...]
    outputs:
      default:
        type: elasticsearch
        hosts:
          - 'https://da4e3a6298c14a6683e6064ebfve9ace.us-central1.gcp.cloud.es.io:443'
        api_key: _Nj4oH0aWZVGqM7MGop8:349p_U1ERHyIc4Nm8_AYkw <1>
    [...]
    1. For more information required privileges and creating API keys, see Grant standalone {{agent}}s access to {{es}}.
  4. Make sure the assets you need, such as dashboards and ingest pipelines, are set up in {{kib}} and {{es}}. If you used {{kib}} to generate the standalone configuration, the assets are set up automatically. Otherwise, you need to install them. For more information, refer to View integration assets and Install integration assets.

  5. From the agent directory, run the following commands to install {{agent}} and start it as a service.

    ::::{note} On macOS, Linux (tar package), and Windows, run the install command to install {{agent}} as a managed service and start the service. The DEB and RPM packages include a service unit for Linux systems with systemd, so just enable then start the service. ::::

    :::::{tab-set}

    ::::{tab-item} macOS

    :::{tip} You must run this command as the root user because some integrations require root privileges to collect sensitive data. :::

    sudo ./elastic-agent install

    ::::

    ::::{tab-item} Linux

    :::{tip} You must run this command as the root user because some integrations require root privileges to collect sensitive data. :::

    sudo ./elastic-agent install

    ::::

    ::::{tab-item} Windows

    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 you installed {{agent}}, and run:

    .\elastic-agent.exe install

    ::::

    ::::{tab-item} DEB

    sudo systemctl enable elastic-agent <1>
    sudo systemctl start elastic-agent
    1. The DEB package includes a service unit for Linux systems with systemd. On these systems, you can manage {{agent}} by using the usual systemd commands. If you don’t have systemd, run sudo service elastic-agent start. ::::

    ::::{tab-item} RPM

    sudo systemctl enable elastic-agent <1>
    sudo systemctl start elastic-agent
    1. The RPM package includes a service unit for Linux systems with systemd. On these systems, you can manage {{agent}} by using the usual systemd commands. If you don’t have systemd, run sudo service elastic-agent start. ::::

    :::::

Refer to Installation layout for the location of installed {{agent}} files.

Because {{agent}} is installed as an auto-starting service, it will restart automatically if the system is rebooted.

If you run into problems, refer to Troubleshoot common problems.