user4678: After searching for a while, didn’t find any post regarding this.
I know running node for testnet and mainnet use different configuring files, and on the cardano developer portal, they are showing the same port. But can I run both testnet and mainnet relay node on background (I assume I’d need to change the port number)?
Do I need to make two different cardano-run process?
In that case, it is ok when I run cardano-cli commands just change different network, like testnet-magic ***/–mainnet? Is the rest command the same?
I currently run the testnet as a systemd service, I can definitely just go ahead and run a mainnet node as another service on the background, but I want to ask before head, in case I would messed up the configurations on my server.

user5926: Yes, you would need two separate cardano-node processes, each with their own configuration and their own disk storage directory.
When using cardano-cli  you will need to connect to the correct local domain socket for the network you want to connect to.
Eg for mainnet:
export CARDANO_NODE_SOCKET_PATH=/path/to/mainnet/db/node.socket
cardano-cli ....

or for testnet:
export CARDANO_NODE_SOCKET_PATH=/path/to/testnet/db/node.socket
cardano-cli ....


4678: <p>After searching for a while, didn’t find any post regarding this.</p>
<p>I know running node for <code>testnet</code> and <code>mainnet</code> use different configuring files, and on the cardano developer portal, they are showing the same port. But can I run both <code>testnet</code> and mainnet relay node on background (I assume I’d need to change the port number)?
Do I need to make two different cardano-run process?</p>
<p>In that case, it is ok when I run cardano-cli commands just change different network, like <code>testnet-magic ***</code>/<code>–mainnet</code>? Is the rest command the same?
I currently run the testnet as a systemd service, I can definitely just go ahead and run a <code>mainnet</code> node as another service on the background, but I want to ask before head, in case I would messed up the configurations on my server.</p>
 5926: <p>Yes, you would need two separate <code>cardano-node</code> processes, each with their own configuration and their own disk storage directory.</p>
<p>When using <code>cardano-cli</code>  you will need to connect to the correct local domain socket for the network you want to connect to.</p>
<p>Eg for mainnet:</p>
<pre><code>export CARDANO_NODE_SOCKET_PATH=/path/to/mainnet/db/node.socket
cardano-cli ....
</code></pre>
<p>or for testnet:</p>
<pre><code>export CARDANO_NODE_SOCKET_PATH=/path/to/testnet/db/node.socket
cardano-cli ....
</code></pre>
