Trupeer AI - Create professional product videos and guides
    logo

    NEAR Protocol - Run nearcore locally

    NEAR Dev
    Jul 30, 2025
    106 Views
    0 Comments
    0 Reactions

    106 Views
    0 Comments
    0 Reactions
    Loading video...

    NEAR Protocol - Run nearcore locally (localnet)

    This document provides a step-by-step process for setting up and configuring the NEAR Protocol on a local machine using Docker. It involves pulling the latest stable version, setting up the Docker environment, and configuring the local network for interaction with the NEAR Protocol nodes.

    Step 1

    Navigate to hub.docker.com and search for the NEAR Protocol. Locate the nearprotocol/nearcore image, which is available for each commit made to the master branch.

    Screenshot

    Step 2

    You can find release tags such as 2.7.0-rc.3 (release candidates which are deployed to testnet) or 2.6.5 (stable release for mainnet). Ensure Docker is installed on your system to start and pull the latest stable version.

    Screenshot

    Step 3

    Currently, the latest version is 2.6.5 stable. Let's pull that in. If using arm64 architecture (e.g. Mac with M-series CPUs), specify the --platform parameter with linux/amd64. It should work the same on Windows, Linux, and macOS. So, it is safe to use this parameter everywhere.

    You'll also want to expose the port. The default JSON RPC port for nearcore node interaction is 3030, and let's run bash in interactive mode to perform node configuration and be able to restart the node without loosing the data between the runs.

    docker run --platform linux/amd64 -it --rm -p 3030:3030 nearprotocol/nearcore:2.6.5 bash

    Screenshot

    Step 4

    Inside the container, use the neard binary. Let's check the version.

    Screenshot

    Step 5

    With the near node being there, it's time to initialize it for localnet. Let's set the home folder inside /tmp/neard:

    neard --home /tmp/neard init

    Screenshot

    You can find the config.json, genesis.json, node_key.json, and validator_key.json created in the home directory.

    Screenshot

    Step 6

    There’s no need to check these configurations now. Proceed to run the node immediately.

    neard --home /tmp/neard run

    Screenshot

    Step 7

    The node is now running. Use the terminal to execute the curl command as a sample operation.

    curl http://localhost:3030/status

    Screenshot

    Step 8

    With everything set up, install and configure the NEAR CLI to use the local network. Add a connection using the near command, and following the prompts providing the network name (localnet), RPC URL (http://localhost:3030), and sipping all other settings as they are not applicable.

    Screenshot

    Step 9

    Now use NEAR CLI to access account information for test.near on localnet, retrieving the amount of available local NEAR tokens (these NEAR tokens have no value). Just type near command and follow the interactive prompts -> "account" -> "view-account-summary" ... or use the fully-specified command:

    near account view-account-summary test.near network-config localnet now

    Screenshot

    Step 10

    Let's send transactions with these tokens using the test.near account.

    Screenshot

    Step 11

    We will send NEAR to another account, and since there is only one other account on our localnet, we use it - near. Sign transactions using the plaintext private key of test.near account - you can get it from the validator_key.json in the /tmp/neard home folder.

    Screenshot

    Step 12

    Once the transaction is successfully signed, send it. Here we can see that the tokens transfer transaction is successfully signed, and sent to the network. The transfer is successful!

    Screenshot

    Happy BUIDLing on NEAR!

    U