Documentation

Self-hosted Terraform state management with powerful infrastructure insights.

Products

Velocity Coming Soon

Terraform and OpenTofu plans in seconds, not minutes. Replace the flat state file with a database-backed dependency graph. Independent changes run in parallel.

Subgraph Execution Parallel Operations Resource-Level Locking SQL-Queryable State

Quick Start

Get Stategraph running and store your first Terraform state:

  1. Deploy with Docker Compose - Start Stategraph in minutes
  2. Configure your first state - Connect Terraform to Stategraph
  3. Explore your infrastructure - Browse and query resources

Why Stategraph?

Full control over your data - Self-hosted means your state files never leave your infrastructure. No vendor lock-in, no external dependencies.

Transaction history - Every state change is recorded with timestamps, user information, and the ability to see exactly what changed.

Infrastructure catalog - Go beyond state storage. Browse all your resources, query across all your states, visualize dependencies, analyze blast radius before making changes, and find unmanaged resources.

Simple deployment - Single Docker image with PostgreSQL. No complex setup, no cloud services required.

Architecture

┌─────────────┐     ┌─────────────────────────────────┐
│  Terraform  │────▶│         Stategraph              │
│    CLI      │     │  ┌─────────┐    ┌───────────┐   │
└─────────────┘     │  │  nginx  │───▶│  Backend  │   │
                    │  └─────────┘    └─────┬─────┘   │
┌─────────────┐     │       │               │         │
│   Browser   │────▶│       ▼               ▼         │
│   (UI)      │     │  ┌─────────┐    ┌───────────┐   │
└─────────────┘     │  │   UI    │    │PostgreSQL │   │
                    │  └─────────┘    └───────────┘   │
                    └─────────────────────────────────┘
  • nginx - Reverse proxy handling request routing
  • Backend - OCaml server handling API requests and state operations
  • UI - Next.js web interface for Inventory and Insights
  • PostgreSQL - State storage, transaction logs, and metadata

CLI

The Stategraph CLI (stategraph) provides command-line access for automation and scripting:

# List states
stategraph states list --tenant <tenant-id>

# Run MQL queries
stategraph mql query "SELECT r.type, count(*) FROM resources r GROUP BY r.type ORDER BY r.type"

# Run gap analysis
stategraph tenant gaps analyze --tenant <tenant-id> --provider aws

CLI Documentation

Downloads

Docker images and native binaries for Linux and macOS.

Releases & Downloads

Support