org.openqa.selenium.WebDriverException: Connection refused (Connection refused)

facing the below error while starting Appium using java code.
Connection refused (Connection refused)
Build info: version: ‘3.11.0’, revision: ‘e59cfb3’, time: ‘2018-03-11T20:26:55.152Z’
System info: host: ‘administratotr-Latitude-E5570’, ip: ‘’, ‘Linux’, os.arch: ‘amd64’, os.version: ‘3.19.0-30-generic’, java.version: ‘1.8.0_171’
Driver info: driver.version: AndroidDriver
Caused by: Connection refused (Connection refused)

1 Like

Please include the stacktrace and appium.log for triaging. Also what are your capabilities, and how are you starting the appium server?

Try ‘’ (loopback) or better ‘’ (INADDR_ANY)

You don’t bother to include the linux distro you are using. ‘’ should be the loopback interface also, but can have slightly different behaviors depending on the linux distro you are using. It can also be just plain wrong.

Starting Appium by java programme.

Please include the capabilities, stacktrace, and appium log.

Any update on this? I also get the error when running on bamboo agent. Works fine locally. I connect to using specific port.
(new URL("" + port + "/wd/hub"), capabilities)
And when I check the used ports, I don’t see that ports in use.