# Why is --fleet-server-es required if I already specified --url when installing elastic agent?

**URL:** https://discuss.elastic.co/t/why-is-fleet-server-es-required-if-i-already-specified-url-when-installing-elastic-agent/331169
**Category:** Elastic Observability
**Tags:** fleet
**Created:** [April 30, 2023, 12:43am UTC](https://discuss.elastic.co/t/why-is-fleet-server-es-required-if-i-already-specified-url-when-installing-elastic-agent/331169 "2023-04-30T00:43:04Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![learningelastic](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@learningelastic](https://discuss.elastic.co/u/learningelastic)
#### Post date: [April 30, 2023, 12:43am UTC](https://discuss.elastic.co/t/why-is-fleet-server-es-required-if-i-already-specified-url-when-installing-elastic-agent/331169/1 "2023-04-30T00:43:04Z")

</div>

I already have a fleet server and elastic instance set up in the cloud somewhere at `https://fleet.example.net:8220` and `https://elastic.example.net:9200`.

Next, I want to install an elastic agent on my laptop. I downloaded the elastic agent on to my laptop. Then I successfully ran this command on my laptop to enroll my elastic agent into the fleet server in the cloud:

```auto
./elastic-agent install --url=https://fleet.example.net:8220 `
  --fleet-server-es=https://elastic.example.net:9200 `
  --fleet-server-service-token=AAEAAWVsYXN0aWMvZmxlZXQtc2VydmVyL3Rva2VuLTE2ODI1Mzg2MzE4NDQ6VjR6a0JpbDlSR5l3R2JmVXB4TFQ0Zc `
  --fleet-server-policy=fleet-server-policy

>Elastic Agent has been successfully installed

```

Now I see entries appearing in my `logs-*` in `Kibana>Discover`. That's great and all, but I wanted to understand this command further.

According to the `--help`, it says:

1. `--fleet-server-es` will ` Start and run a Fleet Server along side this Elastic Agent connecting to the provided elasticsearch`
2. `--url` will `URL to enroll Agent into Fleet`

Things fail when I omit the `--fleet-server-es` flag, during the `./elastic-agent.exe install` statement on my laptop. My question is **Why?** I already have a fleet server running at `https://fleet.example.net:8220`. Why does my laptop need to create another fleet server or why does it need to reference my elastic server at `https://elastic.example.net:9200`?

---

<div class="post-metadata">

### Author: ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)
#### Post date: [April 30, 2023, 12:56am UTC](https://discuss.elastic.co/t/why-is-fleet-server-es-required-if-i-already-specified-url-when-installing-elastic-agent/331169/2 "2023-04-30T00:56:30Z")

</div>

Hi @learningelastic

Exactly what documentation are you following? What flow are you following, I think you are following the incorrect flow for a Fleet Managed Agent.

You should follow this flow...

> **[Install Fleet-managed Elastic Agents | Fleet and Elastic Agent Guide \[8.7\] |...](https://www.elastic.co/guide/en/fleet/current/install-fleet-managed-elastic-agent.html)**

And if you do ... you will note that the install commands look like this from your kibana

 ![Screenshot 2023-04-29 at 5.53.56 PM](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1a2292487b0e9f13f5ec8cae26bde9c38b68af7f.png)

```auto
curl -L -O https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent-8.7.0-darwin-x86_64.tar.gz
tar xzvf elastic-agent-8.7.0-darwin-x86_64.tar.gz
cd elastic-agent-8.7.0-darwin-x86_64
sudo ./elastic-agent install --url=https://05ssafkjashdflkasjdhf.fleet.us-west1.gcp.cloud.es.io:443 --enrollment-token=LKJHlkjhLKJHlkjhLKJHlkjhGR0M6U0lDdml6OUZUWWlYZHpRaFRiOEZ1dw==

```

This is different than what you are trying to do above which is an agent that is a fleet server
