Skip to main content
This guide covers running Graph Node using prebuilt Docker images, either with Docker Compose for a complete local setup or standalone with existing infrastructure.

Prerequisites

Before starting, ensure you have:
  • Docker: Install Docker
  • Docker Compose: Install Docker Compose
  • Ethereum Node: Access to an Ethereum RPC endpoint (local node or provider)
  • Sufficient Resources: At least 4GB RAM and 50GB disk space

Docker Compose Setup

Docker Compose provides the easiest way to run Graph Node locally with all required services.
1

Clone the Repository

First, get the Graph Node repository:
2

Configure Ethereum Connection

Edit docker-compose.yml to set your Ethereum node endpoint. By default, it connects to mainnet:http://host.docker.internal:8545.
Replace with your network and RPC URL:
  • Local node: mainnet:http://host.docker.internal:8545
  • Infura: mainnet:https://mainnet.infura.io/v3/YOUR-PROJECT-ID
  • Alchemy: mainnet:https://eth-mainnet.g.alchemy.com/v2/YOUR-API-KEY
  • Multiple networks: mainnet:http://...,sepolia:http://...
3

Start the Services

Launch all services (Graph Node, PostgreSQL, IPFS):
For background execution:
This creates persistent data directories:
  • ./data/ipfs - IPFS data
  • ./data/postgres - PostgreSQL database
4

Verify Services

Check that all services are running:
Access the endpoints:

Docker Compose Configuration

The complete docker-compose.yml configuration:

Port Reference

HTTP
GraphQL HTTP server for querying subgraphs
WebSocket
GraphQL WebSocket server for subscriptions
JSON-RPC
Admin API for managing subgraphs
HTTP
Indexing status and metrics
HTTP
Prometheus metrics endpoint

Running with Existing Infrastructure

If you already have PostgreSQL and IPFS running, use the standalone Docker image:

Example: Connecting to External Services

Environment Variables

string
required
PostgreSQL server hostname
number
default:"5432"
PostgreSQL server port
string
required
Database username
string
required
Database password
string
required
Database name
string
default:"sslmode=prefer"
Additional PostgreSQL connection arguments
string
required
IPFS node address (e.g., ipfs:5001 or 127.0.0.1:5001)
string
required
Ethereum networks in format NAME:URL. Multiple networks separated by commas.Example: mainnet:http://localhost:8545,sepolia:https://sepolia.infura.io/v3/KEY
string
default:"combined-node"
Node role: combined-node, index-node, or query-node
string
default:"default"
Unique identifier for this node
string
default:"info"
Log level: error, warn, info, debug, trace
string
Path to advanced TOML configuration file (optional)
boolean
Set to any value to disable core dumps (useful for query nodes with large caches)

Apple Silicon (M1/M2) Support

Graph Node doesn’t provide native ARM64 images. On Apple Silicon Macs, build locally:
1

Increase Docker Memory

Open Docker Desktop → Settings → Resources → Advanced → MemorySet to at least 8GB to avoid build failures.
2

Remove Existing Image

3

Build for ARM64

4

Run Docker Compose

Using Configuration Files

For advanced setups (multiple databases, custom chain configs), use a TOML configuration file:
See the Configuration Overview for details on the TOML format.

Deploying Subgraphs

Once Graph Node is running, deploy subgraphs using Graph CLI:
1

Install Graph CLI

2

Create Subgraph

3

Build and Deploy

Troubleshooting

If using host.docker.internal, ensure your Ethereum node binds to 0.0.0.0, not just 127.0.0.1.On Linux, host.docker.internal may not work. Use the host’s IP address instead:
Ensure PostgreSQL allows connections from Docker containers. Check pg_hba.conf and verify the container can reach the host:
Verify IPFS is accessible:
If using external IPFS, ensure it’s publicly accessible or on the same network.
Increase Docker’s memory limit:
  • Docker Desktop: Settings → Resources → Advanced → Memory (set to 8GB+)
  • Linux: Edit /etc/docker/daemon.json to increase memory limits

Managing Services

Next Steps