Metricbeat can not connect to elasticsearch

Hi!

I have a VPS running ELK in docker, ports are lisening, and I cannot connect to it from another machine where i've installed metricbeat. ( tried it from two different machine, same issue) I got a following error after ran testconnection (metricbeat setup -e):

{"log.level":"info","@timestamp":"2024-02-01T14:59:42.214+0100","log.origin":{"file.name":"instance/beat.go","file.line":806},"message":"Home path: [/usr/share/metricbeat] Config path: [/etc/metricbeat] Data path: [/var/lib/metricbeat] Logs path: [/var/log/metricbeat]","service.name":"metricbeat","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2024-02-01T14:59:42.216+0100","log.origin":{"file.name":"instance/beat.go","file.line":814},"message":"Beat ID: d5a9f3fa-2f42-4ea1-b121-b61b0d6be75a","service.name":"metricbeat","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2024-02-01T14:59:42.230+0100","log.logger":"beat","log.origin":{"file.name":"instance/beat.go","file.line":1332},"message":"Beat info","service.name":"metricbeat","system_info":{"beat":{"path":{"config":"/etc/metricbeat","data":"/var/lib/metricbeat","home":"/usr/share/metricbeat","logs":"/var/log/metricbeat"},"type":"metricbeat","uuid":"d5a9f3fa-2f42-4ea1-b121-b61b0d6be75a"},"ecs.version":"1.6.0"}}
{"log.level":"info","@timestamp":"2024-02-01T14:59:42.231+0100","log.logger":"beat","log.origin":{"file.name":"instance/beat.go","file.line":1341},"message":"Build info","service.name":"metricbeat","system_info":{"build":{"commit":"bfdd9fb0a3c4eeeacf5a5bc2110164a177e4cb08","libbeat":"8.11.3","time":"2023-12-08T10:33:39.000Z","version":"8.11.3"},"ecs.version":"1.6.0"}}
{"log.level":"info","@timestamp":"2024-02-01T14:59:42.231+0100","log.logger":"beat","log.origin":{"file.name":"instance/beat.go","file.line":1344},"message":"Go runtime info","service.name":"metricbeat","system_info":{"go":{"os":"linux","arch":"amd64","max_procs":12,"version":"go1.20.11"},"ecs.version":"1.6.0"}}
{"log.level":"info","@timestamp":"2024-02-01T14:59:42.231+0100","log.logger":"beat","log.origin":{"file.name":"instance/beat.go","file.line":1350},"message":"Host info","service.name":"metricbeat","system_info":{"host":{"architecture":"x86_64","boot_time":"2024-02-01T14:59:00+01:00","containerized":false,"name":"desktop-89qdfl1","ip":["127.0.0.1","::1","172.21.38.106","fe80::215:5dff:fee0:134f","172.18.0.1","fe80::42:13ff:feca:78c3","172.17.0.1","fe80::485b:1dff:fe0e:bf94"],"kernel_version":"5.15.133.1-microsoft-standard-WSL2","mac":["00:15:5d:e0:13:4f","02:42:13:ca:78:c3","02:42:a8:b5:15:b9","4a:5b:1d:0e:bf:94"],"os":{"type":"linux","family":"debian","platform":"ubuntu","name":"Ubuntu","version":"22.04.3 LTS (Jammy Jellyfish)","major":22,"minor":4,"patch":3,"codename":"jammy"},"timezone":"CET","timezone_offset_sec":3600,"id":"5b19d6dda4cd45b29e92b450ea802b0f"},"ecs.version":"1.6.0"}}
{"log.level":"info","@timestamp":"2024-02-01T14:59:42.231+0100","log.logger":"beat","log.origin":{"file.name":"instance/beat.go","file.line":1379},"message":"Process info","service.name":"metricbeat","system_info":{"process":{"capabilities":{"inheritable":null,"permitted":["chown","dac_override","dac_read_search","fowner","fsetid","kill","setgid","setuid","setpcap","linux_immutable","net_bind_service","net_broadcast","net_admin","net_raw","ipc_lock","ipc_owner","sys_module","sys_rawio","sys_chroot","sys_ptrace","sys_pacct","sys_admin","sys_boot","sys_nice","sys_resource","sys_time","sys_tty_config","mknod","lease","audit_write","audit_control","setfcap","mac_override","mac_admin","syslog","wake_alarm","block_suspend","audit_read","perfmon","bpf","checkpoint_restore"],"effective":["chown","dac_override","dac_read_search","fowner","fsetid","kill","setgid","setuid","setpcap","linux_immutable","net_bind_service","net_broadcast","net_admin","net_raw","ipc_lock","ipc_owner","sys_module","sys_rawio","sys_chroot","sys_ptrace","sys_pacct","sys_admin","sys_boot","sys_nice","sys_resource","sys_time","sys_tty_config","mknod","lease","audit_write","audit_control","setfcap","mac_override","mac_admin","syslog","wake_alarm","block_suspend","audit_read","perfmon","bpf","checkpoint_restore"],"bounding":["chown","dac_override","dac_read_search","fowner","fsetid","kill","setgid","setuid","setpcap","linux_immutable","net_bind_service","net_broadcast","net_admin","net_raw","ipc_lock","ipc_owner","sys_module","sys_rawio","sys_chroot","sys_ptrace","sys_pacct","sys_admin","sys_boot","sys_nice","sys_resource","sys_time","sys_tty_config","mknod","lease","audit_write","audit_control","setfcap","mac_override","mac_admin","syslog","wake_alarm","block_suspend","audit_read","perfmon","bpf","checkpoint_restore"],"ambient":null},"cwd":"/home/brute","exe":"/usr/share/metricbeat/bin/metricbeat","name":"metricbeat","pid":784,"ppid":783,"seccomp":{"mode":"disabled","no_new_privs":false},"start_time":"2024-02-01T14:59:41.820+0100"},"ecs.version":"1.6.0"}}
{"log.level":"info","@timestamp":"2024-02-01T14:59:42.231+0100","log.origin":{"file.name":"instance/beat.go","file.line":333},"message":"Setup Beat: metricbeat; Version: 8.11.3","service.name":"metricbeat","ecs.version":"1.6.0"}
{"log.level":"warn","@timestamp":"2024-02-01T14:59:42.234+0100","log.logger":"cfgwarn","log.origin":{"file.name":"tlscommon/config.go","file.line":102},"message":"DEPRECATED: Treating the CommonName field on X.509 certificates as a host name when no Subject Alternative Names are present is going to be removed. Please update your certificates if needed. Will be removed in version: 8.0.0","service.name":"metricbeat","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2024-02-01T14:59:42.236+0100","log.logger":"esclientleg","log.origin":{"file.name":"eslegclient/connection.go","file.line":122},"message":"elasticsearch url: http://167.86.83.138:9200","service.name":"metricbeat","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2024-02-01T14:59:42.238+0100","log.logger":"publisher","log.origin":{"file.name":"pipeline/module.go","file.line":105},"message":"Beat name: DESKTOP-89QDFL1","service.name":"metricbeat","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2024-02-01T14:59:42.321+0100","log.logger":"esclientleg","log.origin":{"file.name":"eslegclient/connection.go","file.line":122},"message":"elasticsearch url: http://167.86.83.138:9200","service.name":"metricbeat","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2024-02-01T14:59:42.375+0100","log.logger":"esclientleg","log.origin":{"file.name":"eslegclient/connection.go","file.line":252},"message":"error connecting to Elasticsearch at http://167.86.83.138:9200: Get \"http://167.86.83.138:9200\": EOF","service.name":"metricbeat","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2024-02-01T14:59:42.375+0100","log.origin":{"file.name":"instance/beat.go","file.line":1307},"message":"Exiting: couldn't connect to any of the configured Elasticsearch hosts. Errors: [error connecting to Elasticsearch at http://100.100.100.100:9200: Get \"http://100.100.100.100:9200\": EOF]","service.name":"metricbeat","ecs.version":"1.6.0"}
Exiting: couldn't connect to any of the configured Elasticsearch hosts. Errors: [error connecting to Elasticsearch at http://100.100.100.100:9200: Get "http://100.100.100.100:9200": EOF]

Can anybody help me?