bitcoind is refusing to connect to my other server


By default bitcoind only binds RPC to the loopback interface, so you can only connect to it from localhost. This is for security.

You can allow connections from a specific other machine with -rpcallowip, or in general with -rpcbind, but beware that this substantially increases the attack surface. Moreover, the data sent and received is not encrypted, see Why is JSON-RPC over SSL "strongly discouraged"?.

It's recommended instead to use VPN software to set up a tunnel between the two machines. In such a setup, bitcoind will see the RPC connection as coming from localhost.

  • I will try this soon. Thanks. I am running bitcoind on a VPS. I am not sure exactly what you are saying in the last part, but do you mean you recommend running bitcoind and the site on the same server?
    – 2523454
    Feb 7 '18 at 12:52
  • @2523454: You can do that, and it might be simpler, but it's not what I'm talking about. I'm saying you can set up a virtual private network such that communications from the remote server are forwarded over an encrypted connection, and it's the VPN software on the bitcoind server that actually talks to bitcoind. Pretty standard network admin stuff. Feb 7 '18 at 15:18
  • I already am running it on a VPN. I have 2 VPNs, one for website one for daemon.
    – 2523454
    Feb 7 '18 at 16:26
  • I suspect you mean VPS (virtual private server) not VPN. You would need to set up a VPN between the two VPSes. How to do this is beyond the scope of this site. Feb 7 '18 at 16:33
  • Yes, I meant VPS. I'll try the -rcpallowip flag in about a hour and accept this if it works.
    – 2523454
    Feb 7 '18 at 18:38

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