# APM server is not available (connection refused)

**URL:** <https://discuss.elastic.co/t/apm-server-is-not-available-connection-refused/240718>\
**Category:** APM\
**Tags:** java\
**Created:** [July 10, 2020, 2:56pm UTC](https://discuss.elastic.co/t/apm-server-is-not-available-connection-refused/240718 "2020-07-10T14:56:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![himanshuk467](https://avatars.discourse-cdn.com/v4/letter/h/85f322/32.png) [@himanshuk467](https://discuss.elastic.co/u/himanshuk467)\
**Post date:** [July 10, 2020, 2:56pm UTC](https://discuss.elastic.co/t/apm-server-is-not-available-connection-refused/240718/1 "2020-07-10T14:56:31Z")

</div>

If you are asking about a problem you are experiencing, please use the following template, as it will help us help you. If you have a different problem, please delete all of this text 🙂

**Kibana version** : 7.8.0

**Elasticsearch version** : 7.8.0

**APM Server version** : 7.8.0

**APM Agent language and version** : Java agent version 1.17.0

**Browser version** :  
chrom Version 83.0.4103.61

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**:  
using curl command on linux

**Fresh install or upgraded from other version?** Fresh

**Is there anything special in your setup?** For example, are you using the Logstash or Kafka outputs? Are you using a load balancer in front of the APM Servers? Have you changed index pattern, generated custom templates, changed agent configuration etc.  
No

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:  
I am able to connect to APM server via APM java agent with both running on localhost but when i try to connect to APM server from a remote machine via java agent it says APM server is not available. I have enable rum.enabled = true.

**Steps to reproduce** :

1. Install APM server, elastic search and kibana on the same machine and start all of them.
2. Try running a spring boot application with APM java agent from a different machine where APM server is running .

**Errors in browser console (if relevant)**: NA

**Provide logs and/or server output (if relevant)**:  
2020-07-10 14:06:54,766 [main] INFO co.elastic.apm.agent.configuration.StartupInfo - Starting Elastic APM 1.17.0 as textsearch on Java 11.0.7 ([Amazon.com](http://Amazon.com) Inc.) Linux 4.14.181-140.257.amzn2.x86\_642020-07-10 14:06:54,798 [main] INFO co.elastic.apm.agent.impl.ElasticApmTracer - Tracer switched to RUNNING state2020-07-10 14:06:54,932 [elastic-apm-server-healthcheck] WARN co.elastic.apm.agent.report.ApmServerHealthChecker - Elastic APM server [http://himanshu.ws:8200/](http://himanshu.ws:8200/) is not available (Connection refused (Connection refused))2020-07-10 14:06:54,935 [elastic-apm-remote-config-poller] ERROR co.elastic.apm.agent.configuration.ApmServerConfigurationSource - Connection refused (Connection refused)

---

<div class="post-metadata">

**Author:** ![Eyal\_Koren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyal_koren/32/36830_2.png) [@Eyal\_Koren](https://discuss.elastic.co/u/Eyal_Koren)\
**Post date:** [July 12, 2020, 12:44pm UTC](https://discuss.elastic.co/t/apm-server-is-not-available-connection-refused/240718/2 "2020-07-12T12:44:05Z")

</div>

Hi and welcome to the forum!  
Please check out the [common problems](https://www.elastic.co/guide/en/apm/agent/java/current/trouble-shooting.html#trouble-shooting-common-issues) and other sections in the Troubleshooting section of our documentation.

---

<div class="post-metadata">

**Author:** ![himanshuk467](https://avatars.discourse-cdn.com/v4/letter/h/85f322/32.png) [@himanshuk467](https://discuss.elastic.co/u/himanshuk467)\
**Post date:** [July 13, 2020, 5:35am UTC](https://discuss.elastic.co/t/apm-server-is-not-available-connection-refused/240718/3 "2020-07-13T05:35:12Z")

</div>

Hi

I was able to fix it by replacing host:localhost with host:ip in apm-server.yml.

Thanks

---

<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:** [August 3, 2020, 1:35am UTC](https://discuss.elastic.co/t/apm-server-is-not-available-connection-refused/240718/4 "2020-08-03T01:35:17Z")

</div>

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