// tag::deb[]

// tag::install-tip[]
TIP: You must run this command as the root user because some
integrations require root privileges to collect sensitive data.

// end::install-tip[]

[source,shell]
----
sudo elastic-agent enroll <kibana_url> <enrollment_token> <1>
sudo systemctl enable elastic-agent <2>
sudo systemctl start elastic-agent
----
<1> `kibana_url` is the {kib} URL where {fleet} is running, and
`enrollment_token` is the enrollment token acquired from {fleet}.
<2> 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`.

// end::deb[]

// tag::rpm[]

include::install.asciidoc[tag=install-tip]

[source,shell]
----
sudo elastic-agent enroll <kibana_url> <enrollment_token> <1>
sudo systemctl enable elastic-agent <2>
sudo systemctl start elastic-agent
----
<1> `kibana_url` is the {kib} URL where {fleet} is running, and
`enrollment_token` is the enrollment token acquired from {fleet}.
<2> 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`.

// end::rpm[]

// tag::mac[]

include::install.asciidoc[tag=install-tip]

[source,shell]
----
sudo ./elastic-agent install -f --kibana-url=<kibana_url> --enrollment-token=<enrollment_token> <1> <2>
----
<1> `kibana_url` is the {kib} URL where {fleet} is running, and
`enrollment_token` is the enrollment token acquired from {fleet}.
<2> Omit `-f` to run an interactive installation.

// end::mac[]

// tag::linux[]

include::install.asciidoc[tag=install-tip]

[source,shell]
----
sudo ./elastic-agent install -f --kibana-url=<kibana_url> --enrollment-token=<enrollment_token> <1> <2> <3>
----
<1> `kibana_url` is the {kib} URL where {fleet} is running, and
`enrollment_token` is the enrollment token acquired from {fleet}.
<2> This command requires a system and service manager like systemd.
<3> Omit `-f` to run an interactive installation.

// end::linux[]

// tag::win[]
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:

[source,shell]
----
.\elastic-agent.exe install -f --kibana-url=<kibana_url> --enrollment-token=<enrollment_token> <1> <2>
----
<1> `kibana_url` is the {kib} URL where {fleet} is running, and
`enrollment_token` is the enrollment token acquired from {fleet}.
<2> Omit `-f` to run an interactive installation.

// end::win[]
