# Error installing Fleet Server

**URL:** https://discuss.elastic.co/t/error-installing-fleet-server/306216
**Category:** Beats
**Tags:** elastic-agent
**Created:** [June 2, 2022, 10:57am UTC](https://discuss.elastic.co/t/error-installing-fleet-server/306216 "2022-06-02T10:57:02Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![aviral\_srivastava](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aviral_srivastava/32/98018_2.png) [@aviral\_srivastava](https://discuss.elastic.co/u/aviral_srivastava)
#### Post date: [June 2, 2022, 10:57am UTC](https://discuss.elastic.co/t/error-installing-fleet-server/306216/1 "2022-06-02T10:57:02Z")

</div>

Hi,

My setup:  
Elasticsearch 8.1.0, Kibana 8.1.0, Elastic Agent 8.1.0

Downloaded elastic agent on my windows machine.  
Ran the following command:

```auto
elastic-agent.exe install --fleet-server-es=https://localhost:9200 --fleet-server-service-token=AAEAAWVsYXN0aWMvZmxlZXQtc2VydmVyL3Rva2VuLTE2NTQxNjMwMzc2ODc6bUg4SHI5bDNRWUt3VFdxUVVRMWNuQQ --fleet-server-policy=fleet-server-policy --fleet-server-insecure-http

```

Getting below error:

```auto
Elastic Agent will be installed at C:\Program Files\Elastic\Agent and will run as a service. Do you want to continue? [Y/n]:Y
{"log.level":"info","@timestamp":"2022-06-02T15:26:59.725+0530","log.origin":{"file.name":"cmd/enroll_cmd.go","file.line":744},"message":"Waiting for Elastic Agent to start Fleet Server","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2022-06-02T15:27:05.754+0530","log.origin":{"file.name":"cmd/enroll_cmd.go","file.line":777},"message":"Fleet Server - Error - x509: certificate signed by unknown authority","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2022-06-02T15:27:13.775+0530","log.origin":{"file.name":"cmd/enroll_cmd.go","file.line":777},"message":"Fleet Server - Restarting","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2022-06-02T15:27:29.802+0530","log.origin":{"file.name":"cmd/enroll_cmd.go","file.line":777},"message":"Fleet Server - Error - x509: certificate signed by unknown authority","ecs.version":"1.6.0"}
Error: fleet-server failed: context canceled
For help, please see our troubleshooting guide at https://www.elastic.co/guide/en/fleet/8.1/fleet-troubleshooting.html
Error: enroll command failed with exit code: 1
For help, please see our troubleshooting guide at https://www.elastic.co/guide/en/fleet/8.1/fleet-troubleshooting.html

```

Can anybody help here?

---

<div class="post-metadata">

### Author: ![Edoardo\_Tenani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/edoardo_tenani/32/94302_2.png) [@Edoardo\_Tenani](https://discuss.elastic.co/u/Edoardo_Tenani)
#### Post date: [June 3, 2022, 9:36am UTC](https://discuss.elastic.co/t/error-installing-fleet-server/306216/2 "2022-06-03T09:36:50Z")

</div>

Hello @aviral_srivastava, you can find more information in the provided link: [Troubleshoot common problems | Fleet and Elastic Agent Guide [8.1] | Elastic](https://www.elastic.co/guide/en/fleet/8.1/fleet-troubleshooting.html)

There is a specific section about the error you are seeing: [Troubleshoot common problems | Fleet and Elastic Agent Guide [8.1] | Elastic](https://www.elastic.co/guide/en/fleet/8.1/fleet-troubleshooting.html#agent-enrollment-certs)

TL;DR: pass `--insecure` to `install` command

---

<div class="post-metadata">

### Author: ![aviral\_srivastava](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aviral_srivastava/32/98018_2.png) [@aviral\_srivastava](https://discuss.elastic.co/u/aviral_srivastava)
#### Post date: [June 5, 2022, 12:20pm UTC](https://discuss.elastic.co/t/error-installing-fleet-server/306216/3 "2022-06-05T12:20:58Z")

</div>

Hi,

I added the --insecure to my command like below, but still the same error:

```auto
elastic-agent.exe install --fleet-server-es=https://localhost:9200 --fleet-server-service-token=AAEAAWVsYXN0aWMvZmxlZXQtc2VydmVyL3Rva2VuLTE2NTQ0MjgyMzM3MTY6bV9YVGl5R3lUMG1IUFhaWDVQUUVLdw --fleet-server-policy=fleet-server-policy --fleet-server-insecure-http --insecure

```

I am using a windows machine.

My Elasticsearch is using self-signed certificate which it generates when we first time start the Elasticsearch. It is running on [https://localhost:9200](https://localhost:9200)

I went to Kibana\>Management\>Fleet\>Agent  
I followed the guide given there.  
Chosen the policy: Fleet Server policy 1  
Downloaded the elastic agent, which will act as Fleet Server.  
I selected `Quick Start` as deployment mode for Security. There it mentions Fleet Server will generate a self-signed certificate. But I don't see any certificate generated.  
I added Fleet Server host as [https://localhost:8220](https://localhost:8220)  
I generated a service token from the UI.  
After then, I ran the above command, this time adding --insecure tag. But still the same error. Not what sure what to do from here?

---

<div class="post-metadata">

### Author: ![Edoardo\_Tenani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/edoardo_tenani/32/94302_2.png) [@Edoardo\_Tenani](https://discuss.elastic.co/u/Edoardo_Tenani)
#### Post date: [June 6, 2022, 9:37am UTC](https://discuss.elastic.co/t/error-installing-fleet-server/306216/4 "2022-06-06T09:37:47Z")

</div>

I noticed that you are using some custom flags in you command.

May you try the command as written in the troubleshooting step? So with `--url=https://<fleet-server-ip>:8220 --enrollment-token=<token> --insecure` only?

---

<div class="post-metadata">

### Author: ![ilia19945](https://avatars.discourse-cdn.com/v4/letter/i/cdc98d/32.png) [@ilia19945](https://discuss.elastic.co/u/ilia19945)
#### Post date: [June 6, 2022, 6:54pm UTC](https://discuss.elastic.co/t/error-installing-fleet-server/306216/5 "2022-06-06T18:54:47Z")

</div>

I have the same problem.  
Described [here](https://discuss.elastic.co/t/error-fleet-server-failed-context-canceled-on-trying-to-connect-elastic-with-an-agent/306411)

```auto
{"log.level":"info","@timestamp":"2022-06-06T21:53:05.353+0300","log.origin":{"file.name":"cmd/enroll_cmd.go","file.line":783},"message":"Fleet Server - Error - dial tcp 172.18.0.2:9200: i/o timeout","ecs.version":"1.6.0"}

```

Any suggestions?

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [June 27, 2022, 2:54pm UTC](https://discuss.elastic.co/t/error-installing-fleet-server/306216/6 "2022-06-27T14:54:54Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
