<h3>Install</h3>
<ol>
<li>Download <a href="http://nssm.cc/download" rel="nofollow noreferrer">NSSM</a></li>
<li>Comment out <code>#daemon=1</code> from <code>bitcoin.conf</code> with comment <code>#incompatible with windows service</code></li>
<li>Shut down bitcoin-qt, bitcoind, bitcoin-cli to eliminate any confusion</li>
<li><code>nssm install BitcoinCore &quot;C:\Program Files\Bitcoin\daemon\bitcoind.exe&quot; -datadir=C:\Documents\Data\Bitcoin</code> (use your own path of course)</li>
<li><code>nssm set BitcoinCore DisplayName Bitcoin Core</code></li>
<li><code>nssm set BitcoinCore Description Bitcoin node with a JSON-RPC server</code></li>
<li><a href="https://i.sstatic.net/mNvOi.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/mNvOi.png" alt="enter image description here" /></a></li>
<li><a href="https://i.sstatic.net/fIIfP.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/fIIfP.png" alt="enter image description here" /></a></li>
</ol>
<hr />
<h3>Test</h3>
<ol>
<li>You should be able to see 8333 connections in <code>netstat</code></li>
<li>You will see <code>bitcoind</code> in your task list under Details</li>
<li>If you go to Service(s), it will take you to this service.</li>
<li>bitcoin-qt still works even in testnet mode</li>
<li>bitcoin-cli still works even in <code>-testnet</code></li>
<li>Your app still works even in testnet mode</li>
</ol>
<hr />
<h3>Running mainnet and Testnet both</h3>
<p>Repeat the steps for install, but on step 4, use</p>
<pre><code>nssm install BitcoinCoreTestnet &quot;C:\Program Files\Bitcoin\daemon\bitcoind.exe&quot; -testnet=1 -datadir=C:\Documents\Data\Bitcoin
</code></pre>
<p>You will then be able to take requests for mainnet on port 8332 and testnet on port 18332</p>

CC BY-SA 4.0
2018-07-01T00:15:56.140Z
2018-07-11T16:37:48.737Z
2020-06-16T11:10:03.350Z
toddmo
<h3>Motivation</h3>
<ol>
<li>I don't want to have to have <code>bitcoin-qt</code> running.</li>
<li>I want the control and error handling capabilities that come when something is running as a service.</li>
<li>I want <code>bitcoind</code> to start when windows starts in the event of a server downage</li>
</ol>
<h3>Notes</h3>
<p>I want to service <code>main</code> and <code>testnet</code>, which I think won't be an issue since afaik <code>bitcoind</code> listens on both ports. I'm just mentioning this for more information.</p>

<bitcoind><windows>
Run bitcoind as a service in windows
toddmo
# Run bitcoind as a service in windows

(Asked by: username_0 on 2018-06-29)

### Motivation

1. I don't want to have to have `bitcoin-qt` running.
2. I want the control and error handling capabilities that come when something is running as a service.
3. I want `bitcoind` to start when windows starts in the event of a server downage

### Notes

I want to service `main` and `testnet`, which I think won't be an issue since afaik `bitcoind` listens on both ports. I'm just mentioning this for more information.

**Tags:** bitcoind, windows


---

## 1 answers

### Answer by username_0 on 2018-07-01. Score: 3 | Accepted answer

### Install

1. Download [NSSM](http://nssm.cc/download)
2. Comment out `#daemon=1` from `bitcoin.conf` with comment `#incompatible with windows service`
3. Shut down bitcoin-qt, bitcoind, bitcoin-cli to eliminate any confusion
4. `nssm install BitcoinCore "C:\Program Files\Bitcoin\daemon\bitcoind.exe" -datadir=C:\Documents\Data\Bitcoin` (use your own path of course)
5. `nssm set BitcoinCore DisplayName Bitcoin Core`
6. `nssm set BitcoinCore Description Bitcoin node with a JSON-RPC server`
7. [![enter image description here](https://i.sstatic.net/mNvOi.png)](https://i.sstatic.net/mNvOi.png)
8. [![enter image description here](https://i.sstatic.net/fIIfP.png)](https://i.sstatic.net/fIIfP.png)

---

### Test

1. You should be able to see 8333 connections in `netstat`
2. You will see `bitcoind` in your task list under Details
3. If you go to Service(s), it will take you to this service.
4. bitcoin-qt still works even in testnet mode
5. bitcoin-cli still works even in `-testnet`
6. Your app still works even in testnet mode

---

### Running mainnet and Testnet both

Repeat the steps for install, but on step 4, use

```
nssm install BitcoinCoreTestnet "C:\Program Files\Bitcoin\daemon\bitcoind.exe" -testnet=1 -datadir=C:\Documents\Data\Bitcoin

```

You will then be able to take requests for mainnet on port 8332 and testnet on port 18332


---

