Ganache CLI runs a local simulated Ethereum node based on EthereumJS.
If you are running a Ganache CLI node on a remote machine, you may want to connect to it with MetaMask for development purposes.
- Node.js 12.
Ganache CLI does not properly work with Node.js 14. See Ganache CLI fails with "Error: callback already called".
Install Ganache CLI
npm install -g ganache-cli
Run a Ganache CLI node with remote access
ganache-cli -h IP_ADDRESS
- IP_ADDRESS — the IP address of the machine you are starting the node on.
The Ganache CLI node will start and show you the address it is listening for connections on.
Listening on 184.108.40.206:8545
1. Open your MetaMask and click the network selector:
2. In the network selector, click Custom RPC:
3. In the New RPC URL field, enter the URL in the following format:
- IP_ADDRESS — the IP address of the machine you are running your Ganache CLI node on.
- PORT — the port your Ganache CLI is listening on as provided by the node when started.
4. Click Save.