selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

terrateam logo

Self-host terrateam

20261109-1504-79c2aad

Terraform plan and apply automation from pull requests

ReleaseOpen CoreMPL-2.0
Docker ComposeCompose file & guide
docker compose up setup
Updated2 hours ago
LanguageOCaml
Setup difficultyModerate
Stars
1 327
Ports
3000 (Setup wizard (orchestration-setup container), opened on the host to generate configuration), 8080 (Orchestration server HTTP endpoint inside the container (health checks, console and API behind nginx))
Requires
PostgreSQL
Docker
ghcr.io/stategraph/orchestration-setup
terrateam screenshot 1

What is terrateam?

terrateam alternatives

All self-hosted alternatives to HCP Terraform →

Should you self-host terrateam?

terrateam scores 56/100 on selfhost.directory (how scoring works) and ranks #16 of 28 in CI/CD. It has 1 327 GitHub stars, +39 in the last 30 days.

It shipped 179 stable releases in the past year. The latest, 3.2.28, came out on 9 November 2026.

Setup is moderate: expect some configuration beyond a single command. An official Docker image is available. It is MPL-2.0-licensed and written mostly in OCaml.

Its closest alternative on selfhost.directory is jenkins (83/100, 26 742 stars). It scores higher overall, so compare the two before you pick. See terrateam vs jenkins side by side.

Features

  • AI agent supportAPI access tokens are listed as Enterprise-only in the editions matrix.
  • Apply from pull requestCODEOWNERS enforcement itself is an Enterprise feature.
  • Audit Trail
  • Automerge and rollbacks
  • Cost Estimation
  • Drift DetectionOne schedule per repository in Open Source; multiple schedules are Enterprise.
  • Multiple IaC engines
  • Multi-state transactionsRequires the commercial Infrastructure as a Database edition.
  • Parallel applies with resource-level lockingRequires the commercial Infrastructure as a Database edition.
  • Policy as Code
  • Pull request planning
  • Queryable stateInfrastructure as a Database is commercial (hosted or self-hosted with a license key), not part of the open-source build.
  • Tag-based workspace configuration
  • Web Console

terrateam README

Stategraph

Terraform without the state file bottleneck

Terraform and OpenTofu from pull requests, with state stored as a dependency graph in PostgreSQL.
Plans read only what a change touches. Changes that do not overlap run at the same time.

Website · Docs · Blog · Slack

GitHub Stars Latest Release Join our Slack OCaml License: MPL-2.0


What is Stategraph?

Stategraph runs Terraform and OpenTofu from pull requests, and can store your state as a graph in PostgreSQL instead of a state file. It has two parts:

  • Stategraph Orchestration: plans every pull request on GitHub or GitLab and posts the result as a comment. Policy checks, cost estimates, and approvals run in the review. The apply runs on merge or on a comment. Open source and self-hostable.
  • Stategraph Infrastructure as a Database: stores each state as a dependency graph in PostgreSQL. A plan reads only the resources your change reaches, changes that touch different resources apply at the same time, and you can query every state with SQL. Works from the CLI with any CI; no VCS provider required.

Each part works without the other. You can start with Orchestration against your existing state backend and move the state into the database later.

The Stategraph platform: pull requests, the CLI, the API, and AI agents connect to the Stategraph server, where Orchestration runs on top of Infrastructure as a Database. Together they power policy, remote execution, inventory, cost, security, and compliance.

How to install terrateam

Install terrateam with Docker Compose

Environment variables
GH_ORG, GHE_HOST, DB_HOST, DB_PORT, DB_USER, DB_PASS, DB_NAME, GITHUB_APP_ID, GITHUB_APP_CLIENT_ID, GITHUB_APP_CLIENT_SECRET, GITHUB_APP_PEM, GITHUB_WEBHOOK_SECRET, GITHUB_APP_URL, GITLAB_APP_ID, GITLAB_APP_SECRET, GITLAB_ACCESS_TOKEN, TERRATUNNEL_API_KEY, TERRAT_UI_BASE, TERRAT_WEB_BASE_URL, TERRAT_API_BASE
git clone https://github.com/stategraph/stategraph.git
cd stategraph/docker/terrat
docker compose up setup

Open http://localhost:3000, choose GitHub or GitLab in the wizard, then copy the settings block from its final page into a file named .env next to docker-compose.yml. Stop the wizard and start the rest:

docker compose up -d server

The Compose file defines four services: setup (wizard), db (PostgreSQL), server (Orchestration) and terratunnel (public HTTPS tunnel). Open Source edition only; up to 3 active users a month per GitHub or GitLab installation.

How to configure terrateam

  • DB_HOSTDatabase host
  • DB_PORTDatabase port
  • DB_USERDatabase user
  • DB_PASSDatabase password
  • DB_NAMEDatabase name

terrateam releases & version history

@ Every self-hosted release, weekly

One Monday email with the week's stable releases across the directory.

FAQ

How is this different from Terraform/OpenTofu's pg backend?

The pg backend only stores the state file as a blob, whereas Stategraph normalizes state into queryable resources with relationships and history.

Do I need to run my own database?

PostgreSQL 14 or newer is required; run it yourself, use a managed service, or use a local instance for development.

Can I apply saved plan files to Stategraph?

Yes, saving a plan and applying it later works, which supports review-and-approve workflows.

Does Stategraph support state locking?

Yes, its database-native locking offers finer granularity than traditional file-based locks.

What about sensitive data in state?

State is encrypted at rest with AES-256 and in transit with TLS 1.3, provider credentials are never stored in it, and access is logged with attribution.

How does parallel execution stay safe?

The full dependency graph is built, dependent resources are ordered behind explicit barriers with transactional writes, so only genuinely independent subgraphs run together.

Can I run Stategraph alongside my existing setup before committing?

Yes; because importing is non-destructive, teams run it in plan-only shadow mode while their current pipeline stays the source of truth.

How do I migrate away from Stategraph?

Export state to standard Terraform .tfstate with the CLI and point your backend configuration back to S3, GCS or local storage.

Does Stategraph support multiple state files?

Yes: each state file becomes its own graph, so hundreds of environments or workspaces can live in one database and be queried separately or together.

What happens to my existing state?

Your existing .tfstate is imported on first run, preserving resources, attributes and metadata, and you can export back to that format later.

How does Stategraph relate to Terrateam?

Built by the same team for different layers: Stategraph stores and executes state, Terrateam is the GitOps orchestration layer on top, and each can be adopted alone.

Is this like Terragrunt or Terramate?

No, those are orchestration wrappers around Terraform, while Stategraph reimplements how state is stored and how operations execute.

How do I know if my repo is a good fit?

Run the diagnostics command from your root module: it evaluates the HCL locally and writes a trace of how Stategraph reads it, uploading nothing.

Is Stategraph a drop-in replacement for Terraform?

Deliberately not; it replaces the state file with a database, and that model is what brings subgraph plans, parallel applies and SQL queries.

Do I need to change my Terraform/OpenTofu code?

No rewriting of resources: configurations, modules and providers carry over, though some repository layouts need adjusting to fit the database model before the import is clean.

More in CI/CD

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…