I am running bitcoind in unbuntu 16.04. And a web server running in docker container. When I excuted curl in container bash curl --user user:pass --data-binary '{"jsonrpc":"1.0","method":"getblockchaininfo","params":[]}' -H 'content-type:text/plain;' response is curl: (7) Failed to connect to port 18332: Connection refused

docker inner address . However, curl in command line directly is ok.

Below is .conf setting: server=1 testnet=1 rpcuser=user rpcpassword=pass rpcallowip= rpcport=18332 rpcconnect=

I have tried all possible combinations of ip address and port number. All the results are 'Connection refused' Can anyone advise me how to resolve the problem? Thanks
Regards, Max

2 Answers 2


Since Bitcoin Core 0.17 certain config file options are net-specific. In particular this is true for rpcport.

This means you need to write it as test.rpcport=18332 now.

More information can be found in the 0.17 release notes: https://bitcoincore.org/en/releases/0.17.0/ (look for "Configuration sections for testnet and regtest").

  • Thank you for your help. But I don't think it is the reason why I can't connect bitcoind daemon from docker.
    – max
    Nov 14, 2018 at 19:37

in the versions 0.15+ bitcoind rpc require rpcauth in the bitcoin.conf file.

rpcauth = user: password //generated with python script

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.