[[run-elastic-agent-standalone]]
[role="xpack"]
= Run {agent} standalone (advanced users)

beta[]

Instead of using {fleet} to manage your {agent}s, you can run agents standalone.
With standalone mode, you manually configure and manage the agents locally on
the systems where they are installed. 

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

To save time, use {fleet} in {kib} to generate your standalone configuration:

. Log in to {kib} and go to **Management > Fleet**.

. On the **Agents** tab, click **Add agent**, and look at the deployment
instructions under **Run standalone**.

. If you haven't already, download and extract the {agent} to your host:
+
--
include::{beats-repo-dir}/x-pack/elastic-agent/docs/install-elastic-agent.asciidoc[tag=install-elastic-agent]

See the https://www.elastic.co/downloads/elastic-agent[download page] for other
installation options.
--

. Back in {fleet}, under **Choose an agent policy**, select a policy to use for
the agent. The default policy includes a system integration for collecting logs
and metrics from the host system.

. Under **Configure the agent**, copy or download the policy. Copy this policy
to the `elastic-agent.yml` on the host where the {agent} is extracted.
+
[role="screenshot"]
image::images/kibana-fleet-policies-default-yaml.png[{fleet} showing default agent policy in YAML format]
+
NOTE: The policy generated by {fleet} already contains the correct {es} address
and port for your setup. If you run everything locally, the address is
`127.0.0.1:9200`. If you use our
https://www.elastic.co/cloud/elasticsearch-service[hosted {ess}] on {ecloud},
you can see the {es} endpoint URL by copying it from the overview page of your
deployment.

. Modify `ES_USERNAME` and `ES_PASSWORD` in the outputs section of
`elastic-agent.yml` to use your {es} credentials. For example:
+
[source,yaml]
----
[...]
outputs:
  default:
    type: elasticsearch
    hosts:
      - 'http://localhost:9200'
    username: ES_USERNAME
    password: ES_PASSWORD
[...]
----

. From the agent directory, run the appropriate command to install {agent} as a
managed service and start the service:
+
--
include::{beats-repo-dir}/x-pack/elastic-agent/docs/tab-widgets/run-standalone-widget.asciidoc[]

--
+
This step installs the {agent} files, including the `elastic-agent.yml` file
you modified earlier, into the directory locations described in
<<installation-layout>>.

For additional configuration options, see <<elastic-agent-configuration>>.

//TODO: Find out: does agent still need to be installed under the SYSTEM account for
//Endpoint security to work, or does the install program take care of that
//somehow? 

// Add Javascript and CSS for tabbed panels
include::tab-widgets/code.asciidoc[]
