<p>On Ubuntu your bitcoin.conf file should be located at <code>/home/username/.bitcoin/bitcoin.conf</code></p>

<p>If that file do not exist create it and fill with standard parameters like:</p>

<pre><code>server=1
listen=1
daemon=1
rpcuser=youusername
rpcpassword=yourpassword
rpcallowip=your ip or the rpc commands sending machine
</code></pre>

CC BY-SA 4.0
2019-01-20T23:15:34.813Z
Maybe it should but it isn't:
~/.bitcoin$ ls
banlist.dat  blocks  chainstate  debug.log  fee_estimates.dat  mempool.dat  peers.dat  wallets
Tony
CC BY-SA 4.0
2019-01-22T10:43:11.283Z
Just type 'touch bitcoin.conf' and fill the file with the aforementioned parameters.
AG23
CC BY-SA 4.0
2019-01-20T23:11:14.920Z
2019-01-20T23:11:14.920Z
AG23
<p>The syntax should be</p>

<pre><code>bitcoind -datadir=/mnt/d/blockchain -txindex
</code></pre>

<p>Note the <code>=</code> sign.</p>

<p>This will look for the <code>bitcoin.conf</code> file at <code>/mnt/d/blockchain/bitcoin.conf</code> and will store the blockchain, databases, wallet files, etc, all in <code>/mnt/d/blockchain</code>.  With this option, Bitcoin Core shouldn't read or write anything in <code>~/.bitcoin</code> at all.</p>

CC BY-SA 4.0
2019-01-20T23:18:43.993Z
Lol. Feel embarassed. That worked.
Tony
CC BY-SA 4.0
2019-01-20T23:15:28.193Z
2019-01-20T23:18:53.177Z
2019-01-20T23:18:53.177Z
Nate Eldredge
<p>Just built no gui, no wallet bitcoin on WSL Ubuntu Bionic, Bitcoin v0.17.1.</p>

<p>I want to experiment with bitcoin-cli.</p>

<p>I followed recommendation to run bitcoind -princonsole and it says:
Using config file </p>

<blockquote>
  <p><code>/home/&lt;myusername&gt;/.bitcoin/bitcoin.conf</code></p>
</blockquote>

<p>This file doesn't exist.</p>

<p>I followed some dense discussion on how should this behave to make dumb users happier on github, supposedly there were some merges, but frankly, I have no clue what was the final conclusion and what is or isn't in 0.17.1</p>

<p>Eventually, I understood that datadir must be specified first.</p>

<p>But that doesn't work for me.</p>

<pre><code>~/bitcoin$ bitcoind -datadir /mnt/d/blockchain -txindex
Error: Specified data directory "" does not exist.
</code></pre>

<p>/mnt/d/blockchain definitely exists.</p>

<p>Thanks for any help.</p>

<p> Many thanks to <strong>Nate Eldredge</strong> for pointing out a dumb error of mine and hope someone can help parsing and shedding some light on this:</p>

<p><a href="https://github.com/bitcoin/bitcoin/issues/10746" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin/issues/10746</a></p>

<p>Blockchain download has started and now I am waiting for the end result.</p>

CC BY-SA 4.0
2019-01-21T18:17:59.910Z
Please mark Nate's answer as correct by clicking the checkmark instead of editing your answer
arubi
<bitcoind><bitcoin.conf>
Where is bitcoin.conf and why doesn't bitcoind find existing datadir v0.17.1
Tony
# Where is bitcoin.conf and why doesn't bitcoind find existing datadir v0.17.1

(Asked by: username_0 on 2019-01-20)

Just built no gui, no wallet bitcoin on WSL Ubuntu Bionic, Bitcoin v0.17.1.

I want to experiment with bitcoin-cli.

I followed recommendation to run bitcoind -princonsole and it says:
Using config file

> `/home/<myusername>/.bitcoin/bitcoin.conf`

This file doesn't exist.

I followed some dense discussion on how should this behave to make dumb users happier on github, supposedly there were some merges, but frankly, I have no clue what was the final conclusion and what is or isn't in 0.17.1

Eventually, I understood that datadir must be specified first.

But that doesn't work for me.

```
~/bitcoin$ bitcoind -datadir /mnt/d/blockchain -txindex
Error: Specified data directory "" does not exist.

```

/mnt/d/blockchain definitely exists.

Thanks for any help.

Many thanks to **username_3 username_3** for pointing out a dumb error of mine and hope someone can help parsing and shedding some light on this:

<https://github.com/bitcoin/bitcoin/issues/10746>

Blockchain download has started and now I am waiting for the end result.

**Tags:** bitcoind, bitcoin.conf

> **Comments:**
> **username_1**: Please mark username_3's answer as correct by clicking the checkmark instead of editing your answer  

---

## 2 answers

### Answer by username_3 on 2019-01-20. Score: 3 | Accepted answer

The syntax should be

```
bitcoind -datadir=/mnt/d/blockchain -txindex

```

Note the `=` sign.

This will look for the `bitcoin.conf` file at `/mnt/d/blockchain/bitcoin.conf` and will store the blockchain, databases, wallet files, etc, all in `/mnt/d/blockchain`. With this option, Bitcoin Core shouldn't read or write anything in `~/.bitcoin` at all.

> **Comments:**
> **username_0**: Lol. Feel embarassed. That worked.  

---

### Answer by username_2 on 2019-01-20. Score: 2

On Ubuntu your bitcoin.conf file should be located at `/home/username/.bitcoin/bitcoin.conf`

If that file do not exist create it and fill with standard parameters like:

```
server=1
listen=1
daemon=1
rpcuser=youusername
rpcpassword=yourpassword
rpcallowip=your ip or the rpc commands sending machine

```

> **Comments:**
> **username_0**: Maybe it should but it isn't: ~/.bitcoin$ ls banlist.dat  blocks  chainstate  debug.log  fee_estimates.dat  mempool.dat  peers.dat  wallets  
> **username_2**: Just type 'touch bitcoin.conf' and fill the file with the aforementioned parameters.  

---

