Cannot get BITCOIND RPC connection working on Ubuntu 12.04 or Windows 7


OK, I recently posted trying to get help connecting to BITCOIND using Ubuntu or Windows 7.

In Ubuntu (Virtual Machine under Win7 64bit) 12.04 Desktop LTS I have the following written in my BITCOIN.CONF file located in $HOME/.bitcoin :


I run BITCOIND with following command:

./bitcoind --server --rpcuser=hello1 --rpcpassword=12345

But when I try and connect with the Ruby script (see ) it gives an error saying it can't connect.

Likewise, under Windows 7 I attempt the same procedure and using NIRSOFT cports app I see Bitcoin daemon is only opened under port 8333, not 833*2* as one would expect if RPC connection was active.

I've opened TCP/UDP port 8332-8333 in port forwarding of router.

What on Earth am I doing wrong here? Why can't I connect to Bitcoin daemon via RPC?

==> BONUS QUESTION: I'm quite new to Ubuntu; how do you check open TCP ports at terminal in Ubuntu? (equivalent of netstat in windows)

Wizard Of Ozzie

Posted 2013-12-09T11:51:33.177

Reputation: 4 920

Bonus question: Find another forum, please, where you'll likely hear lsof -i. – pyramids – 2014-03-09T22:33:29.010



I am not familiar about how to run it on windows but for Ubuntu 12.04 I can help you out first you should remove garbage from the conf file which should be located under ~/.bitcoin folder with the name bitcoin.conf with just following text :


^^ is sufficient

now to make bitcoind to reply RPC calls you should have jsonRPCClient files in your computer I am not familiar with ruby but still this link can give you an idea on how to do it. I hope this will help you achieve what you are looking for. And the bonus answer on linux you can use netstat -ntpl to have detailed view on which program is using which port

Khan Shahrukh

Posted 2013-12-09T11:51:33.177

Reputation: 437


Netstat(1) will give you open ports (in this case listening TCP ports): netstat -lnt.

To make sure you know which port your bitcoind daemon is using, start it with paramter -rpcport. In your example, use exactly -rpcport=8332, then use the same port when connecting to it.


Posted 2013-12-09T11:51:33.177


port 8332 NOT OPEN. Can anyone PLEASE help me here? Where is it going wrong?!?! – Wizard Of Ozzie – 2013-12-09T12:07:49.987

Try with just rpcuser, rpcpassword and server. Don't specify rpcallowip (it will default to – ScripterRon – 2013-12-09T17:24:39.730


QT's RPC API is set to listen by default to TCP port 8332.

Take out everything from your bitcoin.conf and leave only: rpcuser=hello1 rpcpassword=12345

Since you have specified the rpcuser and rpcpassword parameters in the bitcoin.conf file you don't need to explicitly specify them in the bitcoind initialization command (you will need to send them from your client, once the daemon is up and running).

In a Command Prompt, run: bitcoind.exe -daemon -debugnet -printtoconsole and then open a new Command Prompt and type: netstat -a, once the RPC API is listening for connections you should see this: TCP myHostName:0 LISTENING

As a note, rpcallowip=* puts your server at risk so I would highly recommend you stop using it immediately.

George Kimionis

Posted 2013-12-09T11:51:33.177

Reputation: 2 854