> ## Documentation Index
> Fetch the complete documentation index at: https://traceroot.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> To set up traceroot in a repository, follow the setup prompt in https://traceroot.ai/docs/getting-started/coding-agents.md.

# Self-Hosting

> Run traceroot on your own infrastructure

> [!NOTE]
>
> Prefer a managed solution? [traceroot Cloud](https://app.traceroot.ai) is maintained by the traceroot team — no setup required.

traceroot is open source and supports self-hosting. Run it on your own infrastructure for full control over your data and deployment. Some features require an enterprise license key.

## Deployment Options

### Local Developer Deployment

Best for: contributing to traceroot, local development, and debugging.

Starts PostgreSQL, ClickHouse, MinIO, and Redis in Docker, then runs the API, UI, and workers locally via a tmux session.

```bash theme={null}
git clone https://github.com/traceroot-ai/traceroot.git
cd traceroot
make dev
```

![traceroot local dev environment running in tmux](https://mintcdn.com/tracerootai/nAvKtOoZR-I95teC/images/local_dev_mode_v1.png?fit=max\&auto=format\&n=nAvKtOoZR-I95teC\&q=85\&s=b6bba382d1a142a0661364d888092d0a)

See the [README](https://github.com/traceroot-ai/traceroot/blob/main/README.md) and [CONTRIBUTING.md](https://github.com/traceroot-ai/traceroot/blob/main/CONTRIBUTING.md) for details.

### Local Docker Deployment

Best for: trying traceroot locally, integration testing, or running a full stack without local dependencies.

Runs the entire stack in containers using Docker Compose — no need to install Python, Node, or other runtimes locally.

```bash theme={null}
git clone https://github.com/traceroot-ai/traceroot.git
cd traceroot
make prod
```

See the [README](https://github.com/traceroot-ai/traceroot/blob/main/README.md) for details.

### Credentials

`make prod` and `make prod-lite` create a `.env` file and fill in credentials for your install: the database and object store passwords, the auth and internal API secrets, and the key that encrypts stored model provider keys and Slack tokens (`ENCRYPTION_KEY`). Each install gets its own values. To use your own, set them in `.env` before starting; a value copied from `.env.example` is not accepted and the stack stops with a message naming the variable to change.

> [!WARNING]
>
> Keep a backup of `.env`. If `ENCRYPTION_KEY` is lost, stored model provider keys and Slack tokens can no longer be read and have to be entered again.

The object store API is published on `127.0.0.1` only. Put a reverse proxy in front of it deliberately if you need access from another machine.

### Upgrading an existing install

1. Pull the latest version and run `make prod-lite` (or `make prod`). This replaces any database or object store password in `.env` that was copied from `.env.example` with a generated one.
2. If the stack stops and names `ENCRYPTION_KEY`, your `.env` still has the key from `.env.example`. Run `make rotate-encryption-key` once. It re-encrypts the stored model provider keys and Slack tokens under a new key in a single transaction, writes the new key to `.env`, and saves the previous one in the `.env.encryption-key.d` directory. If it fails before the database is updated, nothing is changed and you can run it again. If the database was updated but `.env` could not be written, the command says so and keeps the new key in `.env.encryption-key.d/pending`; fix the problem and run it again to finish. It refuses to run while `ENCRYPTION_KEY` is set in your shell environment or `COMPOSE_ENV_FILES` is set, because Docker Compose would then not use the key in `.env`. While a rotation is running, or has not finished, the `make` targets that start the stack wait or refuse, so the services never run with a key the database is being moved away from; to start the stack with `docker compose` yourself, finish the rotation first.
3. Start the stack again with `make prod-lite` (or `make prod`). If you started it with `make prod` before, its tmux session is still there and `make prod` offers to re-attach to it; answer `N` so a new session is started. Re-attaching skips the setup and would leave the stopped services stopped.

Rotation stops the web, worker, agent, detector and billing services first. If it fails they stay stopped, and starting is refused until the rotation has finished: fix the problem and run `make rotate-encryption-key` again (to abandon an unfinished rotation that did not change the database, remove `.env.encryption-key.d/pending` and start as in step 3).

An install that never set `ENCRYPTION_KEY` has nothing stored under it and simply gets a generated one.

### Production Deployment

Best for: production workloads.

traceroot runs on Kubernetes. The deployment lives in two dedicated, versioned repositories, so you can pin a release and upgrade deliberately.

| Repository | What it gives you |
| - | - |
| [traceroot-terraform-aws](https://github.com/traceroot-ai/traceroot-terraform-aws) | A Terraform module that provisions the whole stack on AWS: VPC, EKS, RDS (PostgreSQL), ElastiCache (Redis), ECR, S3, EFS, ACM and an ALB ingress. It then installs the Helm chart for you. |
| [traceroot-k8s](https://github.com/traceroot-ai/traceroot-k8s) | The Helm chart for any Kubernetes cluster. Use it directly to run traceroot on infrastructure you already manage. |

**On AWS**, use the Terraform module. It is the fastest path to a production deployment:

```hcl theme={null}
module "traceroot" {
  source = "github.com/traceroot-ai/traceroot-terraform-aws?ref=<release-tag>"

  environment = "production"
  name        = "traceroot-production"
  aws_region  = "us-east-1"
  vpc_cidr    = "10.0.0.0/16"
  domain      = "traceroot.example.com"
  image_tag   = "<image-tag>"
}
```

See the [module README](https://github.com/traceroot-ai/traceroot-terraform-aws#readme) for every input, and [`examples/quickstart`](https://github.com/traceroot-ai/traceroot-terraform-aws/tree/main/examples/quickstart) for a runnable example.

**On any other Kubernetes cluster**, install the chart with Helm:

```bash theme={null}
helm repo add traceroot https://traceroot-ai.github.io/traceroot-k8s
helm repo update
helm install traceroot traceroot/traceroot -f my-values.yaml
```

See the [chart README](https://github.com/traceroot-ai/traceroot-k8s#readme) and its [`values.yaml`](https://github.com/traceroot-ai/traceroot-k8s/blob/main/charts/traceroot/values.yaml) for configuration.

> [!TIP]
>
> Pin the module `ref` and the chart version to a release rather than tracking `main`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.