PromptHub
Back to Blog
DevOps Infrastructure as Code

Stop Overpaying for Terraform Cloud! Use Terrakube Instead

B

Bright Coding

Author

12 min read 67 views
Stop Overpaying for Terraform Cloud! Use Terrakube Instead

Stop Overpaying for Terraform Cloud! Use Terrakube Instead

What if I told you that your team is bleeding thousands of dollars every month on infrastructure automation—and you don't have to?

Here's the brutal truth that HashiCorp doesn't want you to hear: Terraform Cloud's pricing scales punishingly as your infrastructure grows. Five users? Manageable. Fifty engineers across multiple teams? You're suddenly negotiating enterprise contracts that could fund a small startup. And for what? A remote state backend with some collaboration features that you could run yourself.

But what if there was a battle-tested, open-source alternative that gives you everything Terraform Cloud offers—private module registries, workspace management, VCS integration, RBAC, custom workflows—without the per-user ransom?

Enter Terrakube, the open-source IaC automation and collaboration software that's making platform engineers secretly smile. Compatible with Terraform's BSL license (yes, HashiCorp confirmed it), Terrakube is the self-hosted powerhouse that lets you reclaim control of your infrastructure pipeline without emptying your budget.

Ready to see what you've been missing? Let's dive deep.


What Is Terrakube?

Terrakube is an open-source Infrastructure as Code (IaC) automation and collaboration platform designed to manage Terraform and OpenTofu workflows at scale. Born from the frustration of vendor lock-in and escalating SaaS costs, Terrakube delivers a complete, self-hosted alternative to Terraform Cloud and Terraform Enterprise.

The project is actively maintained by Terrakube IO with a thriving community on Slack, comprehensive documentation, and a clear roadmap driven by real user needs. It's not a weekend experiment—it's production-grade software with proper CI/CD pipelines, SonarCloud coverage tracking, and enterprise sponsors including JetBrains, GitBook, and Docker↗ Bright Coding Blog backing its development.

Why it's trending now:

  • Post-BSL backlash: When HashiCorp switched Terraform to the Business Source License, the open-source community scrambled for alternatives. Terrakube emerged as a legally compatible, functionally equivalent platform.
  • Cost optimization pressure: 2024's economic climate forced engineering leaders to scrutinize every SaaS subscription. Self-hosted tooling became strategic, not just ideological.
  • OpenTofu momentum: As the OpenTofu fork gains traction, teams need automation layers that treat both Terraform and OpenTofu as first-class citizens—Terrakube does exactly this.

The philosophy is simple: your infrastructure code, your control plane, your rules. No arbitrary user limits. No surprise pricing tiers. No begging sales teams for feature flags.


Key Features That Make Terrakube Insane

Let's dissect what makes Terrakube a genuine contender—not just a "free alternative," but a superior architecture for many organizations.

Private Registry for Modules and Providers

Terrakube hosts your Terraform modules and providers internally. This isn't just convenience—it's supply chain security. You control artifact provenance, versioning, and access. No more trusting public registries for critical infrastructure components.

Organizations and Workspaces with Tag-Based Filtering

Multi-tenancy is native, not bolted-on. Structure infrastructure by organization, subdivide into workspaces, then tag and filter dynamically. This mirrors how real engineering teams actually work—platform teams, product squads, environment separation—all cleanly isolated yet centrally observable.

Deep VCS Integration

Native hooks for GitHub (Cloud & Enterprise), GitLab (EE & CE), Bitbucket, and Azure DevOps↗ Bright Coding Blog. Your git push triggers Terrakube workflows automatically. The integration isn't superficial webhooks—it's full repository browsing, branch tracking, and pull request-driven planning.

Full Terraform / OpenTofu Workflow Execution

Run plan, apply, destroy from any browser, any time. Manage variables through the UI or API. Access and version state files with full audit trails. The remote execution model means no local Terraform installations required for team members—critical for security-conscious organizations.

Extensible Custom Workflows

This is where Terrakube pulls ahead of rigid competitors. Integrate Open Policy Agent (OPA) for policy-as-code, Infracost for cost estimation, security scanners, or literally any tool via the extension system. Can't find a pre-built integration? The REST API lets you build bespoke automation. Your pipeline, your tools, your logic.

Enterprise-Grade Access Control via DEX

Authentication through Azure AD, Amazon Cognito, GitHub, SAML, LDAP—practically any identity provider. More importantly, group-based permissions map your existing organizational structure to workspace, module, and VCS access. No duplicate user management. No identity sprawl.

Remote Backend & Cloud Block Support

Terrakube speaks native Terraform protocol. Use remote backend configuration or the cloud block and your CLI commands work seamlessly. Zero workflow changes for teams migrating from Terraform Cloud.


Real-World Use Cases Where Terrakube Dominates

1. The Bootstrapped Startup Avoiding SaaS Traps

You're pre-Series A with five engineers today, but hiring aggressively. Terraform Cloud's per-user pricing would triple your IaC costs before your next funding round. Terrakube on a single Kubernetes cluster costs compute resources only—predictable, scalable, investor-friendly.

2. The Regulated Enterprise Requiring Data Sovereignty

Healthcare, finance, government—sectors where "cloud-hosted" triggers compliance reviews. Terrakube runs entirely within your VPC, on your GKE, EKS, or AKS clusters. State files never leave your network perimeter. Auditors smile. Legal sleeps soundly.

3. The Platform Team Supporting 50+ Microservice Squads

Each squad needs isolated workspaces, shared module libraries, and standardized policies. Terrakube's organization boundaries + tag-based workspace filtering let platform engineers enforce guardrails without becoming bottlenecks. Self-service infrastructure that doesn't sacrifice governance.

4. The OpenTofu Early Adopter Needing Automation Parity

You've switched to OpenTofu for licensing purity, but your old Terraform Cloud workspace won't run it. Terrakube treats Terraform and OpenTofu as equals—same workflows, same state management, same UI. No second-class citizen tooling.

5. The Cost-Conscious Mid-Market Company

You're spending $2,000+/month on Terraform Cloud for 40 users. That same infrastructure on Terrakube? Perhaps $200 in compute. The 10x cost reduction funds an additional engineer—or just improves your runway.


Step-by-Step Installation & Setup Guide

Terrakube offers multiple deployment paths. Here's the fastest path to production and the best local development experience.

Option A: Docker Compose (Fastest Local Start)

Perfect for evaluation and small teams:

# Clone the repository
git clone https://github.com/terrakube-io/terrakube.git
cd terrakube

# Start with Docker Compose
docker-compose up -d

The Docker Compose deployment includes all dependencies—database, message queue, and the Terrakube services—pre-configured for immediate use.

Option B: Helm on Kubernetes (Production Recommended)

For scalable, resilient deployments:

# Add the Terrakube Helm repository
helm repo add terrakube https://terrakube-io.github.io/terrakube
helm repo update

# Install with default configuration
helm install terrakube terrakube/terrakube

# Or customize with values file for production
helm install terrakube terrakube/terrakube -f custom-values.yaml

Critical production considerations:

  • Configure persistent volumes for state storage
  • Set up Ingress with TLS termination
  • Integrate your DEX identity provider before onboarding users
  • Enable PostgreSQL↗ Bright Coding Blog external database rather than embedded storage

Option C: Minikube with HTTPS (Development Realism)

Test TLS, ingress patterns, and multi-service behavior locally:

# Follow the detailed Minikube guide at:
# https://docs.terrakube.io/getting-started/deployment/minikube-+-https

minikube start --driver=docker --kubernetes-version=v1.28.0
# Apply Terrakube manifests with cert-manager for valid HTTPS

Option D: Gitpod (Zero Local Setup)

Click the Gitpod badge in the repository for an instant cloud development environment—ideal for contributors evaluating the codebase.

Post-Installation Configuration

  1. Configure DEX for authentication (edit dex-config.yaml with your IdP details)
  2. Register your VCS provider (GitHub/GitLab/Bitbucket/Azure DevOps app registration)
  3. Create your first Organization via the web UI
  4. Establish workspace templates with your required tooling (OPA, Infracost, etc.)

REAL Code Examples from the Repository

Let's examine actual implementation patterns from Terrakube's architecture and usage models.

Example 1: Terraform Remote Backend Configuration

Terrakube natively supports the standard remote backend. Here's how you configure your existing Terraform projects to use your self-hosted instance:

# backend.tf - Configure Terraform to use Terrakube as remote backend
terraform {
  backend "remote" {
    # Your Terrakube instance hostname
    hostname = "terrakube-api.yourcompany.com"
    
    # Organization name as configured in Terrakube UI
    organization = "platform-team"
    
    workspaces {
      # Workspace name - will be created automatically if it doesn't exist
      name = "production-vpc"
    }
  }
}

What's happening here: The hostname parameter redirects Terraform's API calls from app.terraform.io to your Terrakube instance. The organization and workspace mapping creates the logical separation. Once configured, terraform init, plan, and apply execute remotely through Terrakube's job runner—no local state files, no credential sprawl on developer machines.

Example 2: Cloud Block Configuration (Terraform 1.1+)

Modern Terraform versions prefer the cloud block. Terrakube supports this natively:

# terraform.tf - Using the cloud block for Terrakube integration
terraform {
  cloud {
    # Point to your self-hosted Terrakube API
    hostname = "terrakube-api.yourcompany.com"
    
    organization = "platform-team"
    
    workspaces {
      tags = ["aws↗ Bright Coding Blog", "production", "networking"]
      # Terrakube's tag-based filtering lets you dynamically
      # select workspaces matching these criteria
    }
  }
  
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 5.0"
    }
  }
}

The power of tags: Unlike workspace name hardcoding, tags enable dynamic workspace selection. A single configuration can target multiple environments based on runtime context—perfect for pipeline templates that deploy across dev, staging, and production with identical code.

Example 3: Custom Workflow with OPA Policy Check

Terrakube's extensibility shines in custom workflow definitions. Here's how you integrate Open Policy Agent for mandatory compliance checks:

# .terrakube/workflow.yaml - Custom pipeline definition
workflow:
  # Standard terraform workflow stages
  plan:
    - type: terraformPlan
      step: 100
      
  # Inject OPA policy validation before any apply
  policy:
    - type: opa
      step: 200
      # Reference OPA policies stored in Terrakube registry
      policies:
        - "global/enforce-tags"
        - "global/restrict-regions"
      # Fail the pipeline if policies don't pass
      enforce: true
      
  apply:
    - type: terraformApply
      step: 300
      # Only execute if plan and policy stages succeeded
      depends_on:
        - plan
        - policy

Why this matters: Policy-as-code shifts compliance left into the automation layer, not as a post-hoc audit. The enforce: true flag guarantees no infrastructure deploys without passing your organizational rules. The depends_on structure creates explicit stage ordering—Terrakube's DAG execution ensures reliability.

Example 4: Cost Estimation with Infracost Integration

Financial governance meets infrastructure automation:

# Extended workflow with cost visibility
workflow:
  plan:
    - type: terraformPlan
      step: 100
      
  cost-estimation:
    - type: infracost
      step: 150
      # Break the build if monthly cost delta exceeds threshold
      budget_alert: 500
      # Currency for reporting
      currency: USD
      # Show breakdown in PR comments / UI
      output_format: "table"
      
  policy:
    - type: opa
      step: 200
      
  apply:
    - type: terraformApply
      step: 300

The business impact: Engineers see real dollar implications before merging. The $500 threshold prevents surprise cloud bills from oversized instances or forgotten resources. Integration into the standard workflow means zero friction adoption—cost awareness becomes habitual, not burdensome.


Advanced Usage & Best Practices

State File Strategy

Enable state versioning and locking in your storage backend. Terrakube handles this automatically when using its native remote backend, but verify your PostgreSQL and MinIO (or S3-compatible storage) configurations for retention policies.

Workspace Template Standardization

Define organization-level workflow templates rather than per-workspace configuration. This ensures every team gets OPA, Infracost, and security scanning without individual setup. Override only when genuinely necessary.

API-Driven Automation

Terrakube's REST API enables GitOps-adjacent patterns. Trigger workspace runs from CI pipelines, extract cost reports for FinOps dashboards, or programmatically provision workspaces for new service onboarding. The API documentation at https://docs.terrakube.io covers authentication patterns using your DEX-issued tokens.

DEX Configuration Hardening

  • Enable refresh tokens with rotation for long-lived sessions
  • Map IdP groups to Terrakube roles—avoid manual permission management
  • Configure multiple IdPs for contractor or acquisition scenarios without identity migration

Monitoring & Observability

Export Terrakube metrics to Prometheus. Track queue depths, job durations, and failure rates. Alert on drift between expected and actual workspace states—early warning for configuration tampering or failed reconciliation.


Comparison with Alternatives

Feature Terrakube Terraform Cloud Spacelift Scalr
Pricing Model Free (self-hosted compute only) Per-user SaaS subscription Per-user SaaS subscription Per-user SaaS subscription
Open Source ✅ Apache 2.0 ❌ Proprietary ❌ Proprietary ❌ Proprietary
Self-Hosted Option ✅ Native ❌ Enterprise only ($$$) ❌ No ✅ Available
OpenTofu Support ✅ First-class ❌ No ⚠️ Limited ⚠️ Limited
Custom Workflow Extensibility ✅ Extensions + API ⚠️ Limited run tasks ✅ Custom hooks ✅ Moderate
Private Module Registry ✅ Built-in ✅ Yes ✅ Yes ✅ Yes
Identity Provider Flexibility ✅ DEX (universal) ⚠️ Limited set ⚠️ Limited set ⚠️ Limited set
State File Control ✅ Your infrastructure ❌ HashiCorp-hosted ❌ Vendor-hosted ❌ Vendor-hosted
BSL Compatibility ✅ Confirmed N/A (source) N/A N/A

The decisive factor: If you value data sovereignty, cost predictability, and architectural transparency, Terrakube eliminates compromise. SaaS alternatives optimize for "fast to start"—Terrakube optimizes for "sustainable to scale."


FAQ

Is Terrakube actually production-ready?

Absolutely. Multiple organizations run Terrakube for hundreds of workspaces. The project maintains CI/CD pipelines, code coverage tracking, and regular releases. Enterprise sponsors including Docker and JetBrains validate its maturity.

How does Terrakube handle the Terraform BSL license?

HashiCorp officially confirmed Terrakube's compatibility with Terraform's BSL license. The platform operates as automation tooling around Terraform/OpenTofu, not a derivative work. Full discussion available in the project's GitHub Discussions.

Can I migrate from Terraform Cloud without rewriting everything?

Yes. Terrakube supports identical remote backend and cloud block configurations. Your existing Terraform code requires zero changes—just repoint the hostname. State migration uses standard terraform state pull / terraform state push workflows.

What Kubernetes expertise is required?

For Helm deployments, basic Kubernetes familiarity suffices. The Docker Compose path requires none. The Terrakube documentation provides copy-paste manifests for common scenarios.

How does Terrakube compare to OpenTofu's native tooling?

Terrakube complements OpenTofu—it provides the automation layer (workspaces, RBAC, registry, CI/CD) that OpenTofu intentionally leaves to the ecosystem. They're partners, not competitors.

Is commercial support available?

Community support thrives on Slack. For organizations requiring SLAs, professional services, or custom development, contact the Terrakube maintainers directly through the repository.

What's the minimum infrastructure for a production deployment?

A single Kubernetes node with 4GB RAM and 2 vCPUs handles small teams comfortably. Scale horizontally by adding executor replicas as workspace concurrency demands increase.


Conclusion

The infrastructure automation landscape is fracturing. HashiCorp's licensing pivot created uncertainty. SaaS pricing models punish growth. And engineering teams are waking up to a simple truth: the control plane for your infrastructure shouldn't be someone else's business model.

Terrakube represents something rare—a genuinely open, functionally complete, architecturally sound alternative that doesn't ask you to compromise. Private registries, workspace governance, VCS integration, policy enforcement, cost controls, and universal identity support, all running on infrastructure you control, priced at the cost of compute alone.

Whether you're a startup preserving runway, an enterprise defending compliance boundaries, or a platform team seeking escape velocity from vendor roadmaps, Terrakube deserves your evaluation.

Stop renting your infrastructure automation. Own it.

👉 Star Terrakube on GitHub, join the Slack community, and deploy your first workspace today. The future of IaC collaboration is open source—and it's already here.

Comments (0)

Comments are moderated before appearing.

No comments yet. Be the first to share your thoughts!

Recommended Prompts

View All