Skip to main content

Overview

Graph Node can be installed in several ways depending on your use case:
  • Docker (Recommended): Best for subgraph developers testing locally
  • Docker with existing services: When you already have IPFS and PostgreSQL
  • From source: For contributors and advanced users who need to modify Graph Node
Most subgraph developers should use the Quickstart guide which covers Docker setup. This page provides comprehensive installation details for all methods.
The easiest way to get started with Graph Node is using the pre-configured Docker Compose setup.

Prerequisites

  • Docker 20.10+ and Docker Compose v2.0+
  • An Ethereum RPC endpoint (Infura, Alchemy, or local node)
  • 8GB+ RAM (16GB recommended for Apple Silicon)
  • 20GB+ free disk space

Installation Steps

1

Clone the repository

2

Configure Ethereum connection

Edit docker-compose.yml and update the ethereum environment variable:
Replace http://host.docker.internal:8545 with your Ethereum node URL.
3

Start the services

For production, use detached mode:
4

Verify installation

Check that all services are running:
Test the GraphQL endpoint:

Docker Compose Configuration

The docker-compose.yml file defines three services:

Graph Node

IPFS

PostgreSQL

Data Persistence

Docker Compose stores data in ./data/ with two subdirectories:
  • ./data/ipfs - IPFS blocks and metadata
  • ./data/postgres - PostgreSQL database files
These persist across container restarts. To completely reset:

Method 2: Docker with Existing Services

If you already have IPFS and PostgreSQL running, you can run only the Graph Node container.

Prerequisites

  • PostgreSQL 12+ with the following extensions:
    • pg_trgm
    • btree_gist
    • postgres_fdw
  • IPFS (Kubo) running and accessible
  • Ethereum RPC endpoint

Running Graph Node

For Linux hosts connecting to services on the host machine, use --network="host" or your machine’s IP address instead of localhost.

Docker Environment Variables

Method 3: Building from Source

Building from source is necessary for Graph Node contributors or when you need to modify the code.

Prerequisites

  • OS: Linux, macOS, or Windows (WSL2)
  • RAM: 8GB minimum, 16GB recommended
  • Disk: 20GB+ free space
  • CPU: Multi-core processor recommended

Step 1: Install Rust

Graph Node requires the latest stable Rust compiler:
Verify installation:

Step 2: Install PostgreSQL

Step 3: Configure PostgreSQL

Create a database user and database for Graph Node:
On macOS with Postgres.app, use your username instead of postgres. On fresh Linux installations, you may need to sudo -u postgres psql.
Set the database connection string as an environment variable:
Test the connection:

Step 4: Install IPFS

Verify IPFS is running:

Step 5: Install Protobuf Compiler

Verify installation:

Step 6: Clone and Build Graph Node

1

Clone the repository

2

Install Rust dependencies

3

Build Graph Node

The first build can take 15-30 minutes and requires significant disk space (~10GB for build artifacts).
4

Verify the build

Step 7: Run Graph Node

Start Graph Node with your configuration:
Graph Node will print the ports it’s listening on when it starts. The GraphQL HTTP server defaults to http://localhost:8000.

Ethereum RPC Configuration

The --ethereum-rpc argument format is:
Examples:
Provider Capabilities:
  • archive: Full historical state (required for many subgraphs)
  • traces: Supports debug_traceBlockByNumber (for call handlers)
  • No capabilities: Regular full node

Running as a System Service

For production deployments, run Graph Node as a systemd service:
/etc/systemd/system/graph-node.service
Enable and start the service:
View logs:

Advanced Configuration

Using a Configuration File

For complex setups (multiple chains, database sharding, multiple nodes), use a TOML configuration file:
config.toml
Run with config file:
See the Configuration page for complete details.

Environment Variables

Graph Node behavior can be tuned with environment variables:

Monitoring and Metrics

Graph Node exposes Prometheus metrics on port 8040:
Common metrics:
  • deployment_sync_progress - Sync progress per subgraph
  • ethereum_chain_head_number - Latest block number
  • query_execution_time - Query performance

Verifying Installation

Test your Graph Node installation:
1

Check GraphQL endpoint

Should return the GraphiQL interface HTML.
2

Check available subgraphs

3

Verify Ethereum connection

Check the logs for:
4

Test IPFS

5

Test PostgreSQL

Troubleshooting

Solution: Install build essentials
Symptoms: ERROR: could not open extension control fileSolution: Install PostgreSQL contrib package
Then reconnect and create extensions.
Symptoms: Connection refused on port 5001Solutions:
Symptoms: Build process killed or panicsSolutions:
  • Increase swap space
  • Use cargo build --release -j 2 to limit parallel jobs
  • Build on a machine with more RAM
  • Use pre-built Docker images instead
Common causes:
  1. Database migration fails: Check PostgreSQL logs
  2. Can’t connect to Ethereum: Verify RPC URL
  3. IPFS unreachable: Ensure IPFS daemon is running
  4. Port already in use: Check if another instance is running
Symptoms: ERROR: could not load library... postgres_fdwSolution: This usually means PostgreSQL development files are missing:

Platform-Specific Notes

macOS

  • Use Postgres.app for the easiest PostgreSQL setup
  • Homebrew installs work well for all dependencies
  • Apple Silicon users should expect longer build times
  • Graph Node Docker images are x86_64 only; build locally for ARM64

Linux

  • Prefer system package managers for dependencies
  • On host.docker.internal doesn’t work; use 172.17.0.1 or --network="host"
  • Ensure PostgreSQL accepts local connections in pg_hba.conf
  • Increase file descriptor limits for production: ulimit -n 65536

Windows (WSL2)

  • All development should occur within WSL2, not native Windows
  • Use Ubuntu 20.04+ or Debian for best compatibility
  • Docker Desktop integration with WSL2 works well
  • PostgreSQL should run inside WSL2, not as Windows service

Performance Tuning

PostgreSQL Configuration

For production, tune PostgreSQL settings in postgresql.conf:
Restart PostgreSQL after changes:

Graph Node Optimization

Next Steps

Quickstart

Get Graph Node running quickly with Docker

Configuration

Advanced TOML configuration for production

Deploy a Subgraph

Learn how to create and deploy subgraphs

Environment Variables

Complete environment variable reference