Skip to content
Latchkey

Terragrunt "terragrunt: command not found" in CI

The shell could not find a terragrunt executable on PATH. GitHub-hosted runners ship Terraform but not Terragrunt, so you must install the binary (or use gruntwork-io/terragrunt-action) before any terragrunt step runs.

What this error means

A step calling terragrunt plan or terragrunt run-all apply exits 127 with "terragrunt: command not found", even though terraform version works.

bash
/home/runner/work/_temp/script.sh: line 1: terragrunt: command not found
Error: Process completed with exit code 127.

Common causes

Terragrunt is not preinstalled on the runner

GitHub-hosted images include terraform but not terragrunt. A bare terragrunt call finds nothing on PATH.

The install step was skipped or downloaded to a directory not on PATH

A curl-based install that writes to a folder not exported into $GITHUB_PATH leaves the binary unreachable in later steps.

How to fix it

Install Terragrunt before using it

  1. Add a setup step that downloads the terragrunt release binary.
  2. Move it onto PATH (for example /usr/local/bin).
  3. Confirm with terragrunt --version before the plan step.
.github/workflows/ci.yml
- name: Install Terragrunt
  run: |
    curl -sL -o /usr/local/bin/terragrunt \
      https://github.com/gruntwork-io/terragrunt/releases/download/v0.55.1/terragrunt_linux_amd64
    chmod +x /usr/local/bin/terragrunt
    terragrunt --version

Use the official Terragrunt action

The gruntwork-io/terragrunt-action installs both Terraform and Terragrunt and runs the command for you.

.github/workflows/ci.yml
- uses: gruntwork-io/terragrunt-action@v2
  with:
    tofu_version: 1.7.0
    tg_version: 0.55.1
    tg_command: 'run-all plan'

How to prevent it

  • Pin an explicit Terragrunt version so installs are reproducible.
  • Install Terragrunt and Terraform/OpenTofu in the same setup job.
  • Verify terragrunt --version early so a missing binary fails fast.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →