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.Configure Ethereum Connection
Edit Replace with your network and RPC URL:
docker-compose.yml to set your Ethereum node endpoint. By default, it connects to mainnet:http://host.docker.internal:8545.- 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://...
Example: Multiple Networks
Example: Multiple Networks
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
Verify Services
Check that all services are running:Access the endpoints:
- GraphiQL Interface: http://localhost:8000
- HTTP Queries:
http://localhost:8000/subgraphs/name/<subgraph-name> - WebSocket:
ws://localhost:8001/subgraphs/name/<subgraph-name> - Admin API: http://localhost:8020
- IPFS: http://127.0.0.1:5001
Docker Compose Configuration
The completedocker-compose.yml configuration:
Port Reference
GraphQL HTTP server for querying subgraphs
GraphQL WebSocket server for subscriptions
Admin API for managing subgraphs
Indexing status and metrics
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
PostgreSQL server hostname
PostgreSQL server port
Database username
Database password
Database name
Additional PostgreSQL connection arguments
IPFS node address (e.g.,
ipfs:5001 or 127.0.0.1:5001)Ethereum networks in format
NAME:URL. Multiple networks separated by commas.Example: mainnet:http://localhost:8545,sepolia:https://sepolia.infura.io/v3/KEYNode role:
combined-node, index-node, or query-nodeUnique identifier for this node
Log level:
error, warn, info, debug, tracePath to advanced TOML configuration file (optional)
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:Increase Docker Memory
Open Docker Desktop → Settings → Resources → Advanced → MemorySet to at least 8GB to avoid build failures.
Using Configuration Files
For advanced setups (multiple databases, custom chain configs), use a TOML configuration file:Deploying Subgraphs
Once Graph Node is running, deploy subgraphs using Graph CLI:Troubleshooting
Connection refused to Ethereum node
Connection refused to Ethereum node
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:PostgreSQL connection errors
PostgreSQL connection errors
Ensure PostgreSQL allows connections from Docker containers. Check
pg_hba.conf and verify the container can reach the host:IPFS timeout errors
IPFS timeout errors
Verify IPFS is accessible:If using external IPFS, ensure it’s publicly accessible or on the same network.
Out of memory errors
Out of memory errors
Increase Docker’s memory limit:
- Docker Desktop: Settings → Resources → Advanced → Memory (set to 8GB+)
- Linux: Edit
/etc/docker/daemon.jsonto increase memory limits
Managing Services
Next Steps
- Environment Variables - Complete reference of all configuration options
- Configuration Overview - Advanced multi-database and multi-chain setup
- Building from Source - Compile Graph Node yourself

