Skip to main content

Install Infrahub Collect

This guide shows you how to install Infrahub Collect on your system.

Prerequisites​

Before installing Infrahub Collect, ensure you have:

For Docker deployments:

  • Administrative or sudo access on your system
  • Docker with Docker Compose installed

For Kubernetes deployments:

  • Administrative or sudo access on your system
  • kubectl configured with permissions to read pod logs and execute commands in pods (pods/log and pods/exec) in the Infrahub namespace

If building from source:

  • Git and network access to clone the repository
  • Go 1.21 or later installed

Installation methods​

Download the pre-built binary​

Download the pre-built binary directly:

# Download the appropriate binary for your system
curl https://infrahub.opsmill.io/ops/$(uname -s)/$(uname -m)/infrahub-collect -o infrahub-collect

# Make it executable
chmod +x infrahub-collect

# Move to a directory in your PATH (optional)
sudo mv infrahub-collect /usr/local/bin/

The same binary collects from Docker Compose and Kubernetes deployments — there is no separate in-cluster installation. On Kubernetes, the tool runs from your workstation (or a CI runner) and reaches the cluster through kubectl.

Verify installation​

After installing the CLI, verify it is working correctly:

# Check versions
infrahub-collect version

# Verify environment detection
infrahub-collect environment detect

# Display help
infrahub-collect --help

Expected output:

Version: [git ref]

Configure environment​

Infrahub Collect uses environment variables for configuration. Set these based on your deployment:

Docker Compose deployments​

# Optional: Target a specific project
export INFRAHUB_PROJECT=infrahub-production

# Optional: Custom bundle location
export INFRAHUB_OUTPUT_DIR=/data/bundles/infrahub

Kubernetes deployments​

# Set the namespace
export INFRAHUB_K8S_NAMESPACE=infrahub

# Set kubeconfig if not default
export KUBECONFIG=/path/to/kubeconfig

Validation​

Confirm the CLI can connect to your Infrahub instance:

# List available deployments
infrahub-collect environment list

# Test environment detection
infrahub-collect environment detect

If these commands succeed, installation is complete.