<p>It's perfectly possible to run several LND nodes on the same computer.</p>
<p>This is how I did it:</p>
<ul>
<li>create separate folders for each LND node</li>
<li>In each folder create a lnd.conf file</li>
<li>make sure you set the datadir and the logdir to point to the folders you just created</li>
<li>make sure that each configuration uses <strong>different ports for rpclisten, listen and restlisten</strong></li>
<li>adjust all other configuration to your liking. You can have multiple clients point to the the same btcd client (that's the one I used, but I'm sure it also would work with bitcoind) and the same chain or different chains</li>
<li>run <code>lnd --configfile=path/to/your/lnd.conf</code> for each lnd client you want to run</li>
</ul>
<h3>&quot;pro&quot;-tip</h3>
<p>I've made aliases in <code>.bashrc</code> for the lnd and lncli commands for each different node.
So:</p>
<pre><code>alias lnd-alice=&quot;lnd --configfile=path/to/alice/lnd.conf&quot;
alias lnd-bob=&quot;lnd --configfile=path/to/bob/lnd.conf&quot;
alias lncli-alice=&quot;lncli --rpcserver=localhost:10001 --macaroonpath=path/to/alice/data/chain/bitcoin/mainnet/admin.macaroon&quot;
alias lncli-bob=&quot;lncli --rpcserver=localhost:10002 --macaroonpath=path/to/bob/data/chain/bitcoin/testnet/admin.macaroon&quot;
</code></pre>
<p>To run the lnd node for alice I just type <code>lnd-alice</code> and then <code>lncli-alice create</code> if it's the first time or <code>lncli-alice unlock</code> if the wallet is already initialized. (The macaroon path isn't needed for <code>create</code> and <code>unlock</code> but it doesn't hurt either.)
Same thing for Bob.</p>
<p>This guide was very helpful in finding the right info: <a href="https://dev.lightning.community/tutorial/01-lncli/index.html" rel="nofollow noreferrer">https://dev.lightning.community/tutorial/01-lncli/index.html</a></p>

CC BY-SA 4.0
2019-06-28T07:58:42.903Z
2019-06-28T07:58:42.903Z
2020-06-16T11:10:03.350Z
gijswijs
<p>I have two instances of bitcoind running, one on mainnet, one on testnet, without any problems.</p>

<p>I can't seem to find any decent documentation on running two instances of LND at the same time on the same computer. Currently I switch between the two.</p>

<p>Is it possible? Are there caveats? Any pointers would be appreciated.</p>

CC BY-SA 4.0
2019-05-21T15:03:16.617Z
Have you tried creating two different lnd.conf files, having different ports specification and matching the bitcoin.conf spec, and running two instances of lnd specifing the parameter --configfile?
Stefano Angieri
CC BY-SA 4.0
2019-06-28T08:22:09.177Z
@StefanoAngieri Yup, you were right. I've answered my own question.
gijswijs
<lightning-network-daemon>
Running LND on testnet and mainnet at the same time on the same pc
gijswijs
# Running LND on testnet and mainnet at the same time on the same pc

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

I have two instances of bitcoind running, one on mainnet, one on testnet, without any problems.

I can't seem to find any decent documentation on running two instances of LND at the same time on the same computer. Currently I switch between the two.

Is it possible? Are there caveats? Any pointers would be appreciated.

**Tags:** lightning-network-daemon

> **Comments:**
> **username_1**: Have you tried creating two different lnd.conf files, having different ports specification and matching the bitcoin.conf spec, and running two instances of lnd specifing the parameter --configfile?  
> **username_0**: @username_1 Yup, you were right. I've answered my own question.  

---

## 1 answers

### Answer by username_0 on 2019-06-28. Score: 1 | Accepted answer

It's perfectly possible to run several LND nodes on the same computer.

This is how I did it:

* create separate folders for each LND node
* In each folder create a lnd.conf file
* make sure you set the datadir and the logdir to point to the folders you just created
* make sure that each configuration uses **different ports for rpclisten, listen and restlisten**
* adjust all other configuration to your liking. You can have multiple clients point to the the same btcd client (that's the one I used, but I'm sure it also would work with bitcoind) and the same chain or different chains
* run `lnd --configfile=path/to/your/lnd.conf` for each lnd client you want to run

### "pro"-tip

I've made aliases in `.bashrc` for the lnd and lncli commands for each different node.
So:

```
alias lnd-alice="lnd --configfile=path/to/alice/lnd.conf"
alias lnd-bob="lnd --configfile=path/to/bob/lnd.conf"
alias lncli-alice="lncli --rpcserver=localhost:10001 --macaroonpath=path/to/alice/data/chain/bitcoin/mainnet/admin.macaroon"
alias lncli-bob="lncli --rpcserver=localhost:10002 --macaroonpath=path/to/bob/data/chain/bitcoin/testnet/admin.macaroon"

```

To run the lnd node for alice I just type `lnd-alice` and then `lncli-alice create` if it's the first time or `lncli-alice unlock` if the wallet is already initialized. (The macaroon path isn't needed for `create` and `unlock` but it doesn't hurt either.)
Same thing for Bob.

This guide was very helpful in finding the right info: <https://dev.lightning.community/tutorial/01-lncli/index.html>


---

