Unable to bind any endpoint for RPC server I recently updated my bitcoin docker image to bitcoing v0.18.0 version and can't allow external rpc connections to it now. It binds to localhost if I set rpcallowip=X.X.X.X, then I tried to used rpcbind parameter also, but couldn't set my docker container to allow external rpc connetions.

This is what I get:

bitcoin_1       | 2019-05-23T13:39:34Z Bitcoin Core version v0.18.0 (release build)
bitcoin_1       | 2019-05-23T13:39:34Z Assuming ancestors of block 0000000000000000000f1c54590ee18d15ec70e68c8cd4cfbadb1b4f11697eee have valid signatures.
bitcoin_1       | 2019-05-23T13:39:34Z Setting nMinimumChainWork=0000000000000000000000000000000000000000051dc8b82f450202ecb3d471
bitcoin_1       | 2019-05-23T13:39:34Z Using the 'sse4(1way),sse41(4way),avx2(8way)' SHA256 implementation
bitcoin_1       | 2019-05-23T13:39:34Z Using RdSeed as additional entropy source
bitcoin_1       | 2019-05-23T13:39:34Z Using RdRand as an additional entropy source
bitcoin_1       | 2019-05-23T13:39:34Z Default data directory /root/.bitcoin
bitcoin_1       | 2019-05-23T13:39:34Z Using data directory /home/BTC
bitcoin_1       | 2019-05-23T13:39:34Z Config file: /home/BTC/bitcoin.conf
bitcoin_1       | 2019-05-23T13:39:34Z Using at most 125 automatic connections (1048576 file descriptors available)
bitcoin_1       | 2019-05-23T13:39:34Z Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
bitcoin_1       | 2019-05-23T13:39:34Z Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
bitcoin_1       | 2019-05-23T13:39:34Z Using 0 threads for script verification
bitcoin_1       | 2019-05-23T13:39:34Z Binding RPC on address X.X.X.X port XXXX failed.
bitcoin_1       | 2019-05-23T13:39:34Z Unable to bind any endpoint for RPC server
bitcoin_1       | 2019-05-23T13:39:34Z Error: Unable to start HTTP server. See debug log for details.
bitcoin_1       | Error: Unable to start HTTP server. See debug log for details.
bitcoin_1       | 2019-05-23T13:39:34Z Shutdown: In progress...
bitcoin_1       | 2019-05-23T13:39:34Z scheduler thread start
bitcoin_1       | 2019-05-23T13:39:34Z scheduler thread interrupt
bitcoin_1       | 2019-05-23T13:39:34Z Shutdown: done


My bitcoin.conf file looks like this:

server=1
rpcbind=X.X.X.X
rpcallowip=0.0.0.0/0
rpcport=XXXX
port=XXXX
rpcuser=user
rpcpassword=password
Here's how you fix the rpcbind issue with the latest change in version 0.18.0.

Before 0.18,  if you put rpcallowip=0.0.0.0/0, the value of rpcbind didn't need to be set as it defaulted to all interfaces.  

Now that is no longer the case.  Here's my setup, for running bitcoind in a container through Docker compose:

rpcallowip=0.0.0.0/0
rpcbind=127.0.0.1
# local DNS name (container name used in my Docker Compose file)
rpcbind=bitcoind


The first rpcbind is so I can make RPC calls from inside the container.  The second is so other containers can reach the bitcoind container.

I think this does what you want:


I can RPC from inside the bitcoind container
I can RPC from another container on the same network (as specified in the compose file) to the bitcoind container
I can RPC from my localhost outside the container.


For the last, I exposed port 8332 to my localhost in the compose file and I can curl to the container:



$ curl --user user --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getbestblockhash", "params": [] }'  -H 'content-type: text/plain;' 127.0.0.1:8332/
Enter host password for user 'user':
{"result":"0000000000000000000ece9381a7e0a4020353f4adde7b560a6b2840d5d44cfa","error":null,"id":"curltest"}


The full details of my container setup are here, in case there's something I missed in writing up my answer.