# Running two instances on a single machine (pre-prod and preview)

**URL:** <https://forum.cardano.org/t/running-two-instances-on-a-single-machine-pre-prod-and-preview/127435>\
**Category:** Setup a Stake Pool\
**Created:** [5 February 2024 23:49 UTC](https://forum.cardano.org/t/running-two-instances-on-a-single-machine-pre-prod-and-preview/127435 "2024-02-05T23:49:14Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![HeptaSean](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/heptasean/32/82306_2.png) [@HeptaSean](https://forum.cardano.org/u/HeptaSean)\
**Post date:** [6 February 2024 06:02 UTC](https://forum.cardano.org/t/running-two-instances-on-a-single-machine-pre-prod-and-preview/127435/2 "2024-02-06T06:02:18Z")

</div>

Why would you need separate executables?

> [@Setting up cardano-node with mithril-client on preview, preprod, and mainnet](https://forum.cardano.org/t/setting-up-cardano-node-with-mithril-client-on-preview-preprod-and-mainnet/120798):
>
> My goal with this post is to have cardano-nodes on both testnets – preview and preprod – and on mainnet running as a user, so I can later use them for minting, contract experiments etc. I’m not going to run a pool and this is not about setting up one. To setup as fast and simple as possible, I’m going to use the pre-compiled binaries. Moreover, since we now have Mithril to get snapshots of the chains and do not have to synchronise from the beginning anymore, I’m going to use that. Installing t…

Choosing different ports and different socket files when starting the node is important.

In that setup, I get different ports by

> [@Setting up cardano-node with mithril-client on preview, preprod, and mainnet](https://forum.cardano.org/t/setting-up-cardano-node-with-mithril-client-on-preview-preprod-and-mainnet/120798/1):
>
> Since I want to be able to run the nodes on the different chains/networks in parallel and the port the node itself listens on will be given on the command line and is not set in `config.json`, I create environment files that can be read by the `systemd` unit in the next section:
> 
> ```auto
> $ cat ~/.local/cardano/chains/mainnet/env
> CARDANO_NODE_PORT=3001
> $ cat ~/.local/cardano/chains/preprod/env
> CARDANO_NODE_PORT=3002
> $ cat ~/.local/cardano/chains/preview/env
> CARDANO_NODE_PORT=3003
> 
> ```

and:

> [@Setting up cardano-node with mithril-client on preview, preprod, and mainnet](https://forum.cardano.org/t/setting-up-cardano-node-with-mithril-client-on-preview-preprod-and-mainnet/120798/1):
>
> ```auto
> EnvironmentFile=%h/.local/cardano/chains/%i/env
> ExecStart=%h/.local/bin/cardano-node run […] --port ${CARDANO_NODE_PORT}
> 
> ```

And I get different sockets by:

> [@Setting up cardano-node with mithril-client on preview, preprod, and mainnet](https://forum.cardano.org/t/setting-up-cardano-node-with-mithril-client-on-preview-preprod-and-mainnet/120798/1):
>
> ```auto
> WorkingDirectory=%h/.local/cardano/chains/%i/
> […]
> ExecStart=%h/.local/bin/cardano-node run […] --socket-path socket […]
> 
> ```

---

_[View the full topic](https://forum.cardano.org/t/running-two-instances-on-a-single-machine-pre-prod-and-preview/127435)._
