Surprised this one hasn't been asked yet.

But how / what is the recommended best practice for shutting down bitcoind ?

Right now I'm manually killing the process with either sudo kill {pid} or if this is failing (like just now) using sudo pkill -9 -f bitcoind


EDIT: This answer is deprecated, it applied to an old version of the bitcoind client. Apparently RPC functionality is now removed. Please look at the other answers instead.

I guess using bitcoind stop. I recommend this approach as killing the process could end you up with a corrupted database, from what I have experienced. Use bitcoind --help for all options and bitcoind help for all JSON-RPC commands.

|improve this answer|||||
  • Good thinking. Missed that. – ManreeRist Oct 11 '13 at 19:11
  • 7
    This doesn't work anymore: Error: Command line contains unexpected token 'stop', see bitcoind -h for a list of options.. The correct way to stop bitcoind is bitcoin-cli-stop command (see the other answer with higher vote count). – iaforek Oct 23 '17 at 8:10

I'm not sure if bitcoind stop still works as RPC with newer releases, since somewhere in help sections it says RPC funcionality removed from bitcoind.

Try bitcoin-cli stop.

|improve this answer|||||
  • 5
    Confirmed bitcoin-cli stop works in version 11. – Jonathan Cross Sep 17 '15 at 12:42
  • 2
    Still works in 2017! Use this. – iaforek Oct 23 '17 at 8:14
  • does not work... I did ./xxxcoin-cli stop but nothing happen after that and ./xxxcoind also does not stopped. – creator Feb 21 '18 at 12:29
  • 1
    Yes, it still works. – Ken Sharp Aug 1 '18 at 23:17
  • Does not work with my setup. I think first of all to be able to use bitcoin-cli you have to start bitcoind with option server=1. I did this and still bitcoin-cli getinfo is returning an error. So I suspect bitcoin-cli does not work properly. I have a process in top that is called bitcoin-init. I am not sure if this is the right process that should be active after I started bitcoind or if this some sort of initialisation process and since it uses 100% of my Raspberry CPU it might as well hang and this might be the root of the problem. I appreciate any input. – Ben Aug 28 '19 at 10:18

if you started it using 'bitcoind -daemon' and you are using version 10 or above, then use 'bitcoin-cli stop'

|improve this answer|||||
  • Does not work for me. What could be the reason? Does the daemon need to be started as a server? Is bitcoin-init an initialisation process to bitcoind? Because that is my process in top. – Ben Aug 28 '19 at 10:22

Make sure you specify the same options that you normally use when running bitcoin, for example, if you use a different datadir:

cd C:\Program Files\Bitcoin\daemon
bitcoin-cli -datadir=C:\Bitcoin stop
|improve this answer|||||

In my case, It works that ./bitcoin-cli -regtest stop

|improve this answer|||||

If using testnet, try ./bitcoin-cli -testnet stop

|improve this answer|||||
  • 1
    ./bitcoin-cli stop is enough – 0xb10c Aug 3 '18 at 8:51
  • I don't know why this correct and the only working answer when on testnet was down-voted. ./bitcoin-cli stop is definitely not enough when running 0.18rc on testnet. – Tony Mar 14 '19 at 5:30
  • 1
    It's only enough if you specifically added testnet=1 to your bitcoin.conf. Otherwise the default is for mainnet! – karimkorun Jan 16 at 16:49

CONTROL C will shutdown - bitcoind

|improve this answer|||||
  • The question is "what is the recommended best practise for safely shutting down bitcoind. This answer would be improved by citing sources for this recommendation and explaining why this is safer or as-safe as, for example, the recommendation at en.bitcoin.it/wiki/Bitcoind#Running – RedGrittyBrick Feb 28 at 15:56
  • Hi Jamie, we are looking for long answers that provide some explanation and context. Please do not just give a one-line answers, please explain why you're recommending something as a solution and how it fits in the context of the question. – Murch Feb 29 at 14:17
  • Oops Sorry about that. – Jamie Light Sparks Feb 29 at 17:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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