docker compose.
This tutorial is based on the Hedera Local Node README documentation.
Already familiar with using a cloud service? Check out the other options for setting up and running the Hedera node locally. See the Useful resources section for more information.
Prerequisites
To get started with this tutorial, ensure that you have the following software installed:- Node.js >= v14.x (Check version:
node -v) - NPM >= v6.14.17 (Check version:
npm -v) - Docker >= v20.10.x (Check version:
docker -v) - Docker Compose >= v2.12.3 (Check version:
docker compose version) - Hardware: Minimum 16GB RAM
Installation
- Node.js and NPM: Refer to the official installation guide.
- Docker: See Docker Setup Guide to get docker up and running (note: specific instructions may vary based on the OS).
Getting Started
Clone the GitHub repo, navigate to the project folder using the commands below;Install CLI Tool
The command below can be used to install the official release from the NPM repository.Note: This version may not reflect the most recent changes to the main branch of this repository. It also uses a baked in version of the Docker Compose definitions and will not reflect any local changes made to the repository.
Local development Installation
Install the dependencies locally.Running the Node:
Start the local node (Note: Ensure Docker is running):npm run restartto restart the networknpm run stopto stop the networknpm run generate-accountsto generate new accounts - network must be running first

Verify Running Node
There are different ways to verify that a node is running;- Check Block Number using Hashscan Block Explorer
- Send cURL request to
getBlockNumber
Check Block Number using Hashscan Block Explorer
Visit the local mirror node explorer endpoint (http://localhost:8080/devnet/dashboard) in your web browser. Ensure thatLOCALNET is selected, as this will show you the Hedera network running within your local network.
Select any of the listed blocks to view the details (Consensus, Block, Transaction Hash, etc) for a particular block.


Send cURL request to getBlockNumber
Let’s verify that we are able to interact with Hedera Testnet using JSON-RPC by issuing aneth_getBlockByNumber JSON-RPC request.
Enter the curl command below:
Troubleshooting
Find below some common errors and how to troubleshoot them: Error: Node cannot start properly because necessary ports are in use!- Option 1: Instead of starting another instance of the network, use the
npm run generate-accountsto generate new accounts for an already started network. - Option 2: If you get the above error, ensure that you terminate any existing Docker processes for the local node, and also any other processes that are bound to these port numbers, before running the npm start command. You can run
docker compose down -v,git clean -xfd,git reset --hardto fix this.
Useful Terms
For an in depth explanation of the different terms below, see the glossary documentation.- Accounts list (ED25519 keys)
- Private keys
- Public address
Next Steps
Want to learn how to deploy smart contracts on Hedera? Visit the guide on how to Deploy a Smart Contract Using Hardhat and Hedera JSON-RPC Relay.Summary
In this tutorial, we successfully set up and ran the Hedera local node using the NPM CLI tool, generated default accounts and solved common errors encountered when running the local node.Useful Resources
- Set and Run a Hedera Node using the Local Hedera Package.
- Setup node using Docker CLI.
- Use local network variables to interact with Consensus and Mirror Nodes
- Using Grafana and Prometheus Endpoints.