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.
Method 1: Docker Compose (Recommended)
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
Configure Ethereum connection
Edit Replace
docker-compose.yml and update the ethereum environment variable:http://host.docker.internal:8545 with your Ethereum node URL.Docker Compose Configuration
Thedocker-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
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_trgmbtree_gistpostgres_fdw
- IPFS (Kubo) running and accessible
- Ethereum RPC endpoint
Running Graph Node
Docker Environment Variables
| Variable | Description | Example |
|---|---|---|
postgres_host | PostgreSQL hostname | postgres or 192.168.1.100 |
postgres_port | PostgreSQL port | 5432 |
postgres_user | Database user | graph-node |
postgres_pass | Database password | secure-password |
postgres_db | Database name | graph-node |
ipfs | IPFS API endpoint | 127.0.0.1:5001 |
ethereum | Network and RPC URL | mainnet:https://... |
GRAPH_LOG | Log level | info, debug, trace |
Method 3: Building from Source
Building from source is necessary for Graph Node contributors or when you need to modify the code.Prerequisites
- System Requirements
- Required Software
- 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: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.Step 4: Install IPFS
Step 5: Install Protobuf Compiler
Step 6: Clone and Build Graph Node
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:
archive: Full historical state (required for many subgraphs)traces: Supportsdebug_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
Advanced Configuration
Using a Configuration File
For complex setups (multiple chains, database sharding, multiple nodes), use a TOML configuration file:config.toml
Environment Variables
Graph Node behavior can be tuned with environment variables:Monitoring and Metrics
Graph Node exposes Prometheus metrics on port 8040:deployment_sync_progress- Sync progress per subgraphethereum_chain_head_number- Latest block numberquery_execution_time- Query performance
Verifying Installation
Test your Graph Node installation:Troubleshooting
Build fails with 'error: linker `cc` not found'
Build fails with 'error: linker `cc` not found'
Solution: Install build essentials
PostgreSQL extension installation fails
PostgreSQL extension installation fails
Symptoms: Then reconnect and create extensions.
ERROR: could not open extension control fileSolution: Install PostgreSQL contrib packageIPFS not starting
IPFS not starting
Symptoms:
Connection refused on port 5001Solutions:Out of memory during build
Out of memory during build
Symptoms: Build process killed or panicsSolutions:
- Increase swap space
- Use
cargo build --release -j 2to limit parallel jobs - Build on a machine with more RAM
- Use pre-built Docker images instead
Graph Node crashes on startup
Graph Node crashes on startup
Common causes:
- Database migration fails: Check PostgreSQL logs
- Can’t connect to Ethereum: Verify RPC URL
- IPFS unreachable: Ensure IPFS daemon is running
- Port already in use: Check if another instance is running
'postgres_fdw' extension error
'postgres_fdw' extension error
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.internaldoesn’t work; use172.17.0.1or--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 inpostgresql.conf:
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

