# Apm econnrefused

**URL:** <https://discuss.elastic.co/t/apm-econnrefused/145178>\
**Category:** APM\
**Created:** [August 20, 2018, 1:36pm UTC](https://discuss.elastic.co/t/apm-econnrefused/145178 "2018-08-20T13:36:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Scott\_Newby](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@Scott\_Newby](https://discuss.elastic.co/u/Scott_Newby)\
**Post date:** [August 20, 2018, 1:36pm UTC](https://discuss.elastic.co/t/apm-econnrefused/145178/1 "2018-08-20T13:36:36Z")

</div>

```
Error: connect ECONNREFUSED <host>:8200
at Object._errnoException (util.js:992:11)
at _exceptionWithHostPort (util.js:1014:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)

```

Trying to setup and connect to APM server on Azure ELK Stack. I installed APM on the kibana VM with the APM server configured to listen on localhost:8200.

I'm testing my NodeJS locally on a server and getting the error above, with host replaced with the public ip. Attempting to change the APM host to the public IP results in a 'too many colons in address' error.

On the VM I have port 8200 open inbound and outbound.

Any help would be appreciated.

Thanks

---

<div class="post-metadata">

**Author:** ![roncohen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roncohen/32/22881_2.png) [@roncohen](https://discuss.elastic.co/u/roncohen)\
**Post date:** [August 21, 2018, 10:15am UTC](https://discuss.elastic.co/t/apm-econnrefused/145178/2 "2018-08-21T10:15:23Z")

</div>

Hi Scott,

Thanks for trying out Elastic APM. If you are running the NodeJS app on a different machine from the APM Server, you'll need to get APM Server to listen on a public interface. You can do that by starting APM Server with a configuration setting like so:

```
./apm-server -E apm-server.host=0.0.0.0:8200

```

You can also edit the `apm-server.yml` to achieve the same:

```auto
apm-server:
  host: localhost:8200

```

You'll want to familiarize yourself with the security implications of opening up a port to the world: [https://www.elastic.co/guide/en/apm/get-started/master/install-and-run.html#secure-api-access](https://www.elastic.co/guide/en/apm/get-started/master/install-and-run.html#secure-api-access)

best of luck!

/Ron

---

<div class="post-metadata">

**Author:** ![Scott\_Newby](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@Scott\_Newby](https://discuss.elastic.co/u/Scott_Newby)\
**Post date:** [August 21, 2018, 12:57pm UTC](https://discuss.elastic.co/t/apm-econnrefused/145178/3 "2018-08-21T12:57:24Z")

</div>

The resolution was to mimic the Kibana yml (auto generated with the Azure ELK stack template) and set the following:

```
apm-server:
    host: <Private IP>:8200
```

---

<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:** [September 11, 2018, 8:57am UTC](https://discuss.elastic.co/t/apm-econnrefused/145178/4 "2018-09-11T08:57:43Z")

</div>

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