<p>Change the <code>-datadir</code> flag to a new absolute location. Each instance will follow the <code>bitcoind.conf</code> in their respective directory. </p>

CC BY-SA 3.0
2013-10-04T14:54:49.680Z
There is little to no documentation on this topic, so I guess I'll just ask here: I specify a datadir flag by typing `./bitcoind -datadir /dir/location/here/`, is that correct?
bvpx
CC BY-SA 3.0
2013-10-05T04:22:10.020Z
That's correct.
Anonymous
CC BY-SA 3.0
2017-12-06T23:49:27.850Z
./bitcoind -datadir=/dir/location/here/ don't forget the =
Badr Bellaj
CC BY-SA 3.0
2013-10-04T04:42:49.687Z
2013-10-04T04:42:49.687Z
Anonymous
<p>Probably, better to add new user.</p>

<p>Simply create new user:</p>

<pre><code># adduser bitcoin1
# adduser bitcoin2
# su -l bitcoin1 -c 'bitcoind'
# su -l bitcoin2 -c 'bitcoind'
</code></pre>

CC BY-SA 3.0
2013-10-06T00:12:30.453Z
2013-10-06T00:12:30.453Z
perpetuity
<p>How to run two instances with same wallet</p>

<pre><code>sudo su -
./xcoind stop
cp -r .xcoin xcoin2

cat .xcoin/xcoin.conf
---
rpcport=3776
port=3777
---

vi ./xcoin2/xcoin.conf
---
rpcport=3876
port=3877
addnode=127.0.0.1:3777
---

./xcoind &amp;
./xcoind -datadir=/root/xcoin2 &amp;
</code></pre>

CC BY-SA 3.0
2014-08-30T23:13:07.083Z
2014-08-30T23:32:49.117Z
2014-08-30T23:32:49.117Z
fujicoin
<p>I want to run two instances of bitcoind on my machine.</p>

<p>I know my bitcoin.conf file is in ./bitcoin/bitcoin.conf, and I know (thanks to <a href="https://bitcoin.stackexchange.com/questions/1270/is-it-possible-to-run-more-than-one-client-instance-on-a-machine">this thread</a>) that I need to change my .conf file to point to different data dirs and RPC ports, etc.</p>

<p>However there is only one .conf file.</p>

<p>How do I go about pointing my second bitcoind instance to a new bitcoin.conf file? I copied the directory with the compiled code to a new directory, I am making the assumption that compiled code can be copied into another directory and it will work without problems.</p>

<bitcoind><linux>
How do I run two instances of bitcoind on the same linux machine with different conf files?
bvpx
# How do I run two instances of bitcoind on the same linux machine with different conf files?

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

I want to run two instances of bitcoind on my machine.

I know my bitcoin.conf file is in ./bitcoin/bitcoin.conf, and I know (thanks to [this thread](https://bitcoin.stackexchange.com/questions/1270/is-it-possible-to-run-more-than-one-client-instance-on-a-machine)) that I need to change my .conf file to point to different data dirs and RPC ports, etc.

However there is only one .conf file.

How do I go about pointing my second bitcoind instance to a new bitcoin.conf file? I copied the directory with the compiled code to a new directory, I am making the assumption that compiled code can be copied into another directory and it will work without problems.

**Tags:** bitcoind, linux


---

## 3 answers

### Answer by username_1 on 2013-10-04. Score: 4

Change the `-datadir` flag to a new absolute location. Each instance will follow the `bitcoind.conf` in their respective directory.

> **Comments:**
> **username_0**: There is little to no documentation on this topic, so I guess I'll just ask here: I specify a datadir flag by typing `./bitcoind -datadir /dir/location/here/`, is that correct?  
> **username_1**: That's correct.  
> **username_2**: ./bitcoind -datadir=/dir/location/here/ don't forget the =  

---

### Answer by username_3 on 2013-10-06. Score: 3

Probably, better to add new user.
Simply create new user:
# adduser bitcoin1
# adduser bitcoin2
# su -l bitcoin1 -c 'bitcoind'
# su -l bitcoin2 -c 'bitcoind'


---

### Answer by username_4 on 2014-08-30. Score: 1

How to run two instances with same wallet
sudo su -
./xcoind stop
cp -r .xcoin xcoin2

cat .xcoin/xcoin.conf
---
rpcport=3776
port=3777
---

vi ./xcoin2/xcoin.conf
---
rpcport=3876
port=3877
addnode=127.0.0.1:3777
---

./xcoind &
./xcoind -datadir=/root/xcoin2 &


---

