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

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:

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"}


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

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