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

<p>You can allow connections from a specific other machine with <code>-rpcallowip</code>, or in general with <code>-rpcbind</code>, but beware that this substantially increases the attack surface.  Moreover, the data sent and received is not encrypted, see <a href="https://bitcoin.stackexchange.com/questions/39117/why-is-json-rpc-over-ssl-strongly-discouraged">Why is JSON-RPC over SSL &quot;strongly discouraged&quot;?</a>. </p>

<p>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.</p>

CC BY-SA 3.0
2018-02-07T12:52:10.267Z
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
CC BY-SA 3.0
2018-02-07T15:18:50.207Z
@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](https://en.wikipedia.org/wiki/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.
Nate Eldredge
CC BY-SA 3.0
2018-02-07T16:26:28.523Z
I already am running it on a VPN. I have 2 VPNs, one for website one for daemon.
2523454
CC BY-SA 3.0
2018-02-07T16:33:04.007Z
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.
Nate Eldredge
CC BY-SA 3.0
2018-02-07T18:38:41.023Z
Yes, I meant VPS. I'll try the -rcpallowip flag in about a hour and accept this if it works.
2523454
CC BY-SA 3.0
2018-02-07T04:41:21.983Z
2018-02-07T04:41:21.983Z
Nate Eldredge
<p>bitcoind is refusing to connect to my other server</p>

<bitcoind><json-rpc><php><network>
bitcoind is refusing to connect to my other server
2523454
# bitcoind is refusing to connect to my other server

(Asked by: username_0 on 2018-02-07)

bitcoind is refusing to connect to my other server

**Tags:** bitcoind, json-rpc, php, network


---

## 1 answers

### Answer by username_1 on 2018-02-07. Score: 0 | Accepted answer

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"?](https://bitcoin.stackexchange.com/questions/39117/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.

> **Comments:**
> **username_0**: 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?  
> **username_1**: @username_0: 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](https://en.wikipedia.org/wiki/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.  
> **username_0**: I already am running it on a VPN. I have 2 VPNs, one for website one for daemon.  
> **username_1**: 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.  
> **username_0**: Yes, I meant VPS. I'll try the -rcpallowip flag in about a hour and accept this if it works.  

---

