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

<p>Try <code>bitcoin-cli stop</code>.</p>

CC BY-SA 3.0
2015-09-17T12:42:11.403Z
Confirmed `bitcoin-cli stop` works in version 11.
Jonathan Cross
CC BY-SA 3.0
2017-10-23T08:14:27.450Z
Still works in 2017! Use this.
iaforek
CC BY-SA 3.0
2018-02-21T12:29:05.123Z
does not work...  I did ./xxxcoin-cli stop   but nothing happen after that and ./xxxcoind also does not stopped.
creator
CC BY-SA 4.0
2018-08-01T23:17:07.970Z
Yes, it still works.
Ken Sharp
CC BY-SA 4.0
2019-08-28T10:18:54.987Z
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.
bomben
CC BY-SA 4.0
2023-02-08T07:06:44.477Z
Try `sudo bitcoin-cli stop` if that throws an error about RPC credentials
ㅤㅤㅤ
CC BY-SA 3.0
2015-05-26T21:46:20.487Z
2015-05-26T21:46:20.487Z
Aliakbar Ahmadi
<p>if you started it using 'bitcoind -daemon'
and you are using version 10 or above, then use 'bitcoin-cli stop'</p>

CC BY-SA 4.0
2019-08-28T10:22:54.020Z
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`.
bomben
CC BY-SA 3.0
2015-05-26T09:40:07.910Z
2015-05-26T09:40:07.910Z
Sean Bradley
<p>In my case, It works that <code>./bitcoin-cli -regtest stop</code></p>

CC BY-SA 4.0
2018-11-26T07:21:58.147Z
2018-11-26T07:21:58.147Z
Mike Min
<p>Make sure you specify the same options that you normally use when running bitcoin, for example, if you use a different datadir:</p>

<pre><code>cd C:\Program Files\Bitcoin\daemon
bitcoin-cli -datadir=C:\Bitcoin stop
</code></pre>

CC BY-SA 3.0
2017-12-11T01:00:17.330Z
2017-12-11T01:00:17.330Z
Frank Forte
<p>This worked for me:</p>
<p>bitcoin-cli -rpcuser=[username] -rpcpassword=[password] -rpcconnect=[ip] stop</p>

CC BY-SA 4.0
2022-03-16T16:09:03.623Z
2022-03-16T16:09:03.623Z
dikukid
<p>If using testnet, try <code>./bitcoin-cli -testnet stop</code></p>

CC BY-SA 4.0
2018-08-03T08:51:56.923Z
`./bitcoin-cli stop` is enough
0xb10c
CC BY-SA 4.0
2019-03-14T05:30:49.670Z
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
CC BY-SA 4.0
2020-01-16T16:49:56.837Z
It's only enough if you specifically added testnet=1 to your bitcoin.conf. Otherwise  the default is for mainnet!
karimkorun
CC BY-SA 4.0
2018-08-02T16:22:42.610Z
2018-08-02T16:22:42.610Z
liaoming
<p><strong>EDIT: This answer is deprecated, it applied to an old version of the <code>bitcoind</code> client. Apparently RPC functionality is now removed. Please look at the other answers instead.</strong></p>

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

CC BY-SA 3.0
2013-10-11T19:11:13.817Z
Good thinking. Missed that.
ManreeRist
CC BY-SA 3.0
2017-10-23T08:10:49.497Z
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
CC BY-SA 4.0
2020-04-17T18:44:57.897Z
The correct way, as shown by Aliakbar Ahmadi and confirmed by Jonathan Cross is `bitcoin-cli stop`. Note the last space as opposed to a hyphen.
BlackBeltBob
CC BY-SA 4.0
2013-10-11T06:52:14.097Z
2020-01-08T19:06:02.637Z
2020-01-08T19:06:02.637Z
Jori
<p>Surprised this one hasn't been asked yet.</p>

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

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

<bitcoind>
How to safely shutdown bitcoind ?
ManreeRist
# How to safely shutdown bitcoind ?

(Asked by: username_0 on 2013-10-10)

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`

**Tags:** bitcoind


---

## 7 answers

### Answer by username_16 on 2013-10-11. Score: 17 | Accepted answer

**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.

> **Comments:**
> **username_0**: Good thinking. Missed that.  
> **username_3**: 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).  
> **username_17**: The correct way, as shown by username_1 username_1 and confirmed by username_2 is `bitcoin-cli stop`. Note the last space as opposed to a hyphen.  

---

### Answer by username_1 on 2015-05-26. Score: 78

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`.

> **Comments:**
> **username_2**: Confirmed `bitcoin-cli stop` works in version 11.  
> **username_3**: Still works in 2017! Use this.  
> **username_4**: does not work...  I did ./xxxcoin-cli stop   but nothing happen after that and ./xxxcoind also does not stopped.  
> **username_5**: Yes, it still works.  
> **username_6**: 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.  
> **username_7**: Try `sudo bitcoin-cli stop` if that throws an error about RPC credentials  

---

### Answer by username_8 on 2015-05-26. Score: 9

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

> **Comments:**
> **username_6**: 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`.  

---

### Answer by username_9 on 2018-11-26. Score: 3

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


---

### Answer by username_10 on 2017-12-11. Score: 2

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

```


---

### Answer by username_11 on 2022-03-16. Score: 1

This worked for me:

bitcoin-cli -rpcuser=[username] -rpcpassword=[password] -rpcconnect=[ip] stop


---

### Answer by username_12 on 2018-08-02. Score: 0

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

> **Comments:**
> **username_13**: `./bitcoin-cli stop` is enough  
> **username_14**: 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.  
> **username_15**: It's only enough if you specifically added testnet=1 to your bitcoin.conf. Otherwise  the default is for mainnet!  

---

