<p>Try to allow RPC calls on particular IP or whitelist all IP's, for example:</p>

<pre><code>rpcallowip=0.0.0.0/0
</code></pre>

<p>Plus try to check <code>debug.log</code> if the connection appeared on daemon it should report. If not, probably firewall issues on a system itself.</p>

CC BY-SA 4.0
2019-10-27T10:23:45.463Z
just for confirmation should i use my vps public ip or its local ip in rpc bind?
Sumit kumar
CC BY-SA 4.0
2019-10-27T10:43:16.570Z
can you try `rpcbind=0.0.0.0` & and try to not use any special characters in credentials. If that works, just add a firewall rule in order to secure the daemon.
pr0logas
CC BY-SA 4.0
2019-10-27T11:03:48.753Z
yes firewall part worked for me turn out it was blocking port 8332 thanks :)
Sumit kumar
CC BY-SA 4.0
2019-10-26T18:29:22.037Z
2019-10-26T18:29:22.037Z
pr0logas
<p>i cannot get it to work firstly i was able to use bitcoind in my vps (locally) but when i added rpcbind and allowip to my bitcoin.conf i cannot even use bitcoin-cli its giving me this error:
error: Authorization failed: Incorrect rpcuser or rpcpassword
while I'm using the same exact user pass as in my config</p>

<p>curl is giving me empty response on port "8333" and connection refused on port 8332</p>

<p>here is my bitcoin.conf [stripped ip and user/pass]</p>

<p>(i was using this one before when it was working locally)</p>

<pre><code>listen=1
server=1
rpcport=8332
prune=600
maxconnections=12
maxuploadtarget=20
rpcuser=XXXXX
rpcpassword=XXXXX
daemon=1
keypool=10000
</code></pre>

<p>now When I'm trying to get it to work on my remote server with this config</p>

<pre><code># Generated by https://jlopp.github.io/bitcoin-core-config-generator/

# This config should be placed in following path:
# ~/.bitcoin/bitcoin.conf
server=1
# [core]
# Maintain a full transaction index, used by the getrawtransaction rpc call.
# Run in the background as a daemon and accept commands.
daemon=1
# Reduce storage requirements by only storing most recent N MiB of block. This mode is incompatible with -txindex and -rescan. WARNING: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, greater than 550 = automatically prune blocks to stay under target size in MiB).
prune=600

# [rpc]
# Accept public REST requests.
rest=1
# Bind to given address to listen for JSON-RPC connections. This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times. (default: 127.0.0.1 and ::1 i.e., localhost, or if -rpcallowip has been specified, 0.0.0.0 and :: i.e., all addresses)
rpcbind=~MY REMOTE VPS PUBLIC IP~
# Username and hashed password for JSON-RPC connections. The field &lt;userpw&gt; comes in the format: &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. RPC clients connect using rpcuser=&lt;USERNAME&gt;/rpcpassword=&lt;PASSWORD&gt; arguments. You can generate this value with the ./share/rpcauth/rpcauth.py script in the Bitcoin Core repository. This option can be specified multiple times.
rpcuser=XXXXXXX
rpcpassword=XXXXXXXX
# Allow JSON-RPC connections from specified source. Valid for &lt;ip&gt; are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times.
rpcallowip=~MY HOST IP~
# Number of seconds after which an uncompleted RPC call will time out
rpcservertimeout=60

# [wallet]
# Legacy
addresstype=legacy
# Legacy
changetype=legacy
# Set key pool size to &lt;n&gt;. Recommended to use a large number for high volume non-HD wallets.
keypool=10000
# If paytxfee is not set, include enough fee so that transactions should confirm within &lt;n&gt; blocks
txconfirmtarget=3
# Broadcast transactions created by the wallet.
walletbroadcast=0
# Run a thread to flush wallet periodically.
flushwallet=0


# [Sections]
# Most options automatically apply to mainnet, testnet, and regtest networks.
# If you want to confine an option to just one network, you should add it in the relevant section.
# EXCEPTIONS: The options addnode, connect, port, bind, rpcport, rpcbind and wallet
# only apply to mainnet unless they appear in the appropriate section below.

maxconnections=12
maxuploadtarget=20

# Options only for mainnet
[main]

# Options only for testnet
[test]

# Options only for regtest
[regtest]
</code></pre>

<bitcoin-core><bitcoind><json-rpc>
Bitcoin JSON RPC not working on Remote IP
Sumit kumar
# Bitcoin JSON RPC not working on Remote IP

(Asked by: username_0 on 2019-10-26)

i cannot get it to work firstly i was able to use bitcoind in my vps (locally) but when i added rpcbind and allowip to my bitcoin.conf i cannot even use bitcoin-cli its giving me this error:
error: Authorization failed: Incorrect rpcuser or rpcpassword
while I'm using the same exact user pass as in my config

curl is giving me empty response on port "8333" and connection refused on port 8332

here is my bitcoin.conf [stripped ip and user/pass]

(i was using this one before when it was working locally)

```
listen=1
server=1
rpcport=8332
prune=600
maxconnections=12
maxuploadtarget=20
rpcuser=XXXXX
rpcpassword=XXXXX
daemon=1
keypool=10000

```

now When I'm trying to get it to work on my remote server with this config

```
# Generated by https://jlopp.github.io/bitcoin-core-config-generator/

# This config should be placed in following path:
# ~/.bitcoin/bitcoin.conf
server=1
# [core]
# Maintain a full transaction index, used by the getrawtransaction rpc call.
# Run in the background as a daemon and accept commands.
daemon=1
# Reduce storage requirements by only storing most recent N MiB of block. This mode is incompatible with -txindex and -rescan. WARNING: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, greater than 550 = automatically prune blocks to stay under target size in MiB).
prune=600

# [rpc]
# Accept public REST requests.
rest=1
# Bind to given address to listen for JSON-RPC connections. This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times. (default: 127.0.0.1 and ::1 i.e., localhost, or if -rpcallowip has been specified, 0.0.0.0 and :: i.e., all addresses)
rpcbind=~MY REMOTE VPS PUBLIC IP~
# Username and hashed password for JSON-RPC connections. The field <userpw> comes in the format: <USERNAME>:<SALT>$<HASH>. RPC clients connect using rpcuser=<USERNAME>/rpcpassword=<PASSWORD> arguments. You can generate this value with the ./share/rpcauth/rpcauth.py script in the Bitcoin Core repository. This option can be specified multiple times.
rpcuser=XXXXXXX
rpcpassword=XXXXXXXX
# Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times.
rpcallowip=~MY HOST IP~
# Number of seconds after which an uncompleted RPC call will time out
rpcservertimeout=60

# [wallet]
# Legacy
addresstype=legacy
# Legacy
changetype=legacy
# Set key pool size to <n>. Recommended to use a large number for high volume non-HD wallets.
keypool=10000
# If paytxfee is not set, include enough fee so that transactions should confirm within <n> blocks
txconfirmtarget=3
# Broadcast transactions created by the wallet.
walletbroadcast=0
# Run a thread to flush wallet periodically.
flushwallet=0

# [Sections]
# Most options automatically apply to mainnet, testnet, and regtest networks.
# If you want to confine an option to just one network, you should add it in the relevant section.
# EXCEPTIONS: The options addnode, connect, port, bind, rpcport, rpcbind and wallet
# only apply to mainnet unless they appear in the appropriate section below.

maxconnections=12
maxuploadtarget=20

# Options only for mainnet
[main]

# Options only for testnet
[test]

# Options only for regtest
[regtest]

```

**Tags:** bitcoin-core, bitcoind, json-rpc


---

## 1 answers

### Answer by username_1 on 2019-10-26. Score: 0 | Accepted answer

Try to allow RPC calls on particular IP or whitelist all IP's, for example:

```
rpcallowip=0.0.0.0/0

```

Plus try to check `debug.log` if the connection appeared on daemon it should report. If not, probably firewall issues on a system itself.

> **Comments:**
> **username_0**: just for confirmation should i use my vps public ip or its local ip in rpc bind?  
> **username_1**: can you try `rpcbind=0.0.0.0` & and try to not use any special characters in credentials. If that works, just add a firewall rule in order to secure the daemon.  
> **username_0**: yes firewall part worked for me turn out it was blocking port 8332 thanks :)  

---

