# How to install elastic agent on remote machine out of docker container using fleet

**URL:** <https://discuss.elastic.co/t/how-to-install-elastic-agent-on-remote-machine-out-of-docker-container-using-fleet/348079>\
**Category:** Kibana\
**Tags:** docker, fleet\
**Created:** [November 27, 2023, 8:01pm UTC](https://discuss.elastic.co/t/how-to-install-elastic-agent-on-remote-machine-out-of-docker-container-using-fleet/348079 "2023-11-27T20:01:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![datalaf](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/datalaf/32/128111_2.png) [@datalaf](https://discuss.elastic.co/u/datalaf)\
**Post date:** [November 27, 2023, 8:01pm UTC](https://discuss.elastic.co/t/how-to-install-elastic-agent-on-remote-machine-out-of-docker-container-using-fleet/348079/1 "2023-11-27T20:01:58Z")

</div>

Hi, i am currently running elasticsearch with kibana on a cloud server in a docker container and i want to use the fleetserver to enroll a elastic agent on a remote linux machine.  
But when i am trying to setup a fleet server using the following command it suggests me:

````auto
sudo ./elastic-agent install \
  --fleet-server-es=http://localhost:9200 \
  --fleet-server-service-token=TOKEN \
  --fleet-server-policy=fleet-server-policy \
  --fleet-server-port=8220```

it trys to connect to http://localhost:9200. If i am trying to change the url to the external ip address of my server i am getting an error on the remote linux client when installing the elastic agent:

````

Error - failed version compatibility check with elasticsearch: tls: failed to verify certificate: x509: certificate is valid for 127.0.0.1, not x.x.x.x","ecs.version":"1.6.0"}

```auto

Does anyone know how to generate a new cert including the external ip?
```

---

<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:** [December 25, 2023, 8:02pm UTC](https://discuss.elastic.co/t/how-to-install-elastic-agent-on-remote-machine-out-of-docker-container-using-fleet/348079/2 "2023-12-25T20:02:31Z")

</div>

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