Skip to main content
Hiero Local Node Deprecation (September 2026) Hiero Local Node is entering a 6-month deprecation period. Support ends September 2026. Migrate local testing and CI workflows to Solo before then. Learn more.
Hedera is an open-source, public, proof-of-stake network. Its network services offer low and fixed fees, 10k TPS, and instant transaction finality. Learn more about the Hedera platform and how it works. In this tutorial, we will adopt, set up, and run a Hedera node locally using the @hashgraph/hedera-local NPM Command Line Interface (CLI) tool with 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

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):
You can pass the following CLI flags, this would be used later in the following sections:
Other NPM commands:
  • npm run restart to restart the network
  • npm run stop to stop the network
  • npm run generate-accounts to generate new accounts - network must be running first
You should see the following response in the terminal:
To generate default accounts and start the local node in detached mode, use the command below:
You should see the following response in the terminal:

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 that LOCALNET 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 an eth_getBlockByNumber JSON-RPC request. Enter the curl command below:
You should get the following response:

Troubleshooting

Find below some common errors and how to troubleshoot them: Error: Node cannot start properly because necessary ports are in use!
Fix
  • Option 1: Instead of starting another instance of the network, use the npm run generate-accounts to 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 --hard to 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

Writer: Owanate, DX Engineer

Editor: Krystal, Senior DX Engineer