> ## Documentation Index
> Fetch the complete documentation index at: https://docs.starknet.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Running a full node

## Overview

Welcome to the first installment of the *Help secure Starknet* guide! 🛡️

By operating your own full node, you become part of the distributed network that validates transactions, preserves blockchain history, and ensures Starknet remains decentralized and censorship-resistant.

This guide will walk you through running your own full node using either [Juno](https://github.com/NethermindEth/juno) or [Pathfinder](https://equilibrium.co/projects/pathfinder).

## Prerequisites

### Installing docker

The easiest option to run a Starknet full node is using Docker. To install Docker, simply visit [docs.docker.com/get-started/get-docker](https://docs.docker.com/get-started/get-docker/) and choose whatever OS you're using.

### Exporting an Ethereum URL

Running a Starknet full node requires an Ethereum websocket RPC URL. You can get your free Ethereum websocket RPC URL by creating an account with [Alchemy](https://www.alchemy.com/), [Infura](https://www.infura.io/), or [Quicknode](https://www.quicknode.com/). Afterwhich, you can export it by running:

```shell theme={null}
export ETHEREUM_URL=<YOUR_URL>

```

# Running Juno

You can run a Juno node using several methods:

* [Docker container](#docker-container)
* [Standalone binary](#standalone-binary)
* [Building from source](#building-from-source)
* [Google Cloud Platform (GCP)](running-on-gcp)

<Note>
  You can use a snapshot to quickly synchronise your node with the network. Check out the [Database Snapshots](snapshots) guide to get started.
</Note>

## Docker container

### 1. Get the Docker image

Juno Docker images can be found at the [nethermind/juno](https://hub.docker.com/r/nethermind/juno) repository on Docker Hub. Download the latest image:

```bash theme={null}
docker pull nethermind/juno
```

You can also build the image locally:

```bash theme={null}
# Clone the Juno repository
git clone https://github.com/NethermindEth/juno
cd juno

# Build the Docker image
docker build -t nethermind/juno:latest .
```

### 2. Run the Docker container

```bash theme={null}
# Prepare the snapshots directory
mkdir -p $HOME/snapshots

# Run the container
docker run -d \
  --name juno \
  -p 6060:6060 \
  -v $HOME/snapshots/juno_mainnet:/snapshots/juno_mainnet \
  nethermind/juno \
  --http \
  --http-port 6060 \
  --http-host 0.0.0.0 \
  --eth-node <YOUR-ETH-NODE> \
  --db-path /snapshots/juno_mainnet
```

You can view logs from the Docker container using the following command:

```bash theme={null}
docker logs -f juno
```

## Standalone binary

Download standalone binaries from [Juno's GitHub Releases](https://github.com/NethermindEth/juno/releases/latest) as ZIP archives for Linux (amd64 and arm64) and macOS (amd64). For macOS (arm64) or Windows users, consider [running Juno using Docker](#docker-container).

```bash theme={null}
# Prepare the snapshots directory
mkdir -p $HOME/snapshots

# Run the binary
./juno \
  --http \
  --http-port 6060 \
  --http-host 0.0.0.0 \
  --eth-node <YOUR-ETH-NODE> \
  --db-path $HOME/snapshots/juno_mainnet
```

You should replace `<YOUR-ETH-NODE>` with your actual Ethereum node address.
If you're using Infura, your Ethereum node address might look something like: `wss://mainnet.infura.io/ws/v3/your-infura-project-id`.
Make sure you are using the WebSockets URL `ws`/`wss` and not the http URL `http`/`https`.

To view logs from the Docker container, use the following command:

```shell theme={null}
docker logs -f juno
```

## Building from source

You can build the Juno binary or Docker image from the source code to access the latest updates or specific versions.

### Prerequisites

* [Golang 1.25](https://go.dev/doc/install) or later
* [Rust](https://www.rust-lang.org/tools/install) 1.87.0 or higher.
* C compiler: `gcc` or `clang`
* [jemalloc](https://github.com/jemalloc/jemalloc)

```mdx-code-block theme={null}
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
```

<Tabs>
  <TabItem value="ubuntu" label="Ubuntu">
    ```bash theme={null}
    sudo apt-get install -y build-essential make libjemalloc-dev libjemalloc2 pkg-config libbz2-dev
    ```
  </TabItem>

  <TabItem value="mac" label="MacOS (Homebrew)">
    ```bash theme={null}
    brew install jemalloc pkg-config
    ```
  </TabItem>
</Tabs>

### 1. Clone the repository

Clone Juno's source code from our [GitHub repository](https://github.com/NethermindEth/juno):

```bash theme={null}
git clone https://github.com/NethermindEth/juno
cd juno
```

<Note>
  You can use `git tag -l` to view specific version tags.
</Note>

### 2. Build the binary or Docker image

```bash theme={null}
# Install juno dependencies
make install-deps

# Build the binary
make juno

# Build the Docker image
docker build -t nethermind/juno:latest .
```

### 3. Run the binary

Locate the standalone binary in the `./build/` directory:

```bash theme={null}
# Prepare the snapshots directory
mkdir -p $HOME/snapshots

# Run the binary
./build/juno \
  --http \
  --http-port 6060 \
  --http-host 0.0.0.0 \
  --db-path $HOME/snapshots/juno_mainnet \
  --eth-node <YOUR-ETH-NODE>
```

# Running Pathfinder

Running a full node involves using your local machine's storage to maintain a full database of the blockchain, all the way from the genesis block.

Database snapshots let you quickly start your node without having to download all blocks from the very beginning, and instead use a pre-made version of the database that's already in sync up to a certain block.

## Downloading a snapshot

To download Pathfinder's snapshot, you first need to download the [rclone](https://rclone.org/) file manager by running:

```shell theme={null}
sudo -v ; curl https://rclone.org/install.sh | sudo bash

```

<Note>
  This installation script can be used to install rclone on Linux/macOS/BSD systems. For other installation methods, see [rclone.org/install](https://rclone.org/install/).
</Note>

Once rclone is downloaded, create a new rclone configuration file:

```shell theme={null}
touch $HOME/.config/rclone/rclone.conf

```

and add the following content:

```shell theme={null}
[pathfinder-snapshots]
type = s3
provider = Cloudflare
env_auth = false
access_key_id = 7635ce5752c94f802d97a28186e0c96d
secret_access_key = 529f8db483aae4df4e2a781b9db0c8a3a7c75c82ff70787ba2620310791c7821
endpoint = https://cbf011119e7864a873158d83f3304e27.r2.cloudflarestorage.com
acl = private

```

Next, create a new `$HOME/pathfinder` directory, navigate into it, and use rclone to copy [Pathfinder's latest database snapshot](https://rpc.pathfinder.equilibrium.co/snapshots/latest) to your local directory by running:

```shell theme={null}
mkdir $HOME/pathfinder
cd $HOME/pathfinder
rclone copy -P pathfinder-snapshots:pathfinder-snapshots/<FILENAME> snapshot.sqlite.zst

```

Once the database snapshot is downloaded, compare the file's checksum value with the one shown at [rpc.pathfinder.equilibrium.co/snapshots/latest](https://rpc.pathfinder.equilibrium.co/snapshots/latest) by running:

```shell theme={null}
sha256sum snapshot.sqlite.zst

```

If the checksum values match, extract the downloaded database snapshot by running:

```shell theme={null}
zstd -T0 -d snapshot.sqlite.zst -o snapshot.sqlite

```

## Using the snapshot

Now that the database snapshot is extracted, you can start your node by running:

```shell theme={null}
docker run \
  --name pathfinder \
  --restart unless-stopped \
  --detach \
  -p 9545:9545 \
  --user "$(id -u):$(id -g)" \
  -e RUST_LOG=info \
  -e PATHFINDER_ETHEREUM_API_URL=$ETHEREUM_URL \
  -v $HOME/pathfinder:/usr/share/pathfinder/data \
  eqlabs/pathfinder

```

Once the docker container is up and running, you can check the docker image's logs by running:

```shell theme={null}
docker logs -f pathfinder

```

If successful, the result should resemble the following:

```shell theme={null}
2025-05-12T18:29:45  INFO Downloading block 766533
2025-05-12T18:30:36  INFO Updated Starknet state with block 766534
2025-05-12T18:31:07  INFO Updated Starknet state with block 766535
2025-05-12T18:31:35  INFO Updated Starknet state with block 766536
2025-05-12T18:32:12  INFO Downloading block 766537

```

<Note>
  To stop the node's execution, run:

  ```shell theme={null}
  docker stop pathfinder
  ```
</Note>
