> For the complete documentation index, see [llms.txt](https://docs.terrakube.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.terrakube.io/2.34.0/getting-started/docker-compose.md).

# Docker Compose

Docker Compose runs the whole stack on one machine, for evaluation and demos. For production use the [Helm chart](/2.34.0/getting-started/deployment/helm-chart.md). If you want to change Terrakube itself, use the [Dev Container](/2.34.0/getting-started/development/dev-container.md) instead.

### Requirements

* Docker Engine or Docker Desktop with the Compose plugin
* [mkcert](https://github.com/FiloSottile/mkcert#installation), to create a locally trusted HTTPS certificate

No custom Docker network, DNS server or `/etc/hosts` entries are needed. The stack uses the `*.localhost` names, which resolve to your machine on their own.

### Start Terrakube

```bash
git clone https://github.com/terrakube-io/terrakube.git
cd terrakube/docker-compose

mkcert -install

mkcert -key-file privkey.pem -cert-file fullchain.pem \
  localhost terrakube.localhost terrakube-api.localhost \
  terrakube-registry.localhost terrakube-executor.localhost \
  terrakube-dex.localhost
cp "$(mkcert -CAROOT)/rootCA.pem" rootCA.pem

docker compose up -d
```

Restart your browser once after `mkcert -install`. After a minute or two open <https://terrakube.localhost> and sign in with `admin@example.com` and password `admin`.

| URL                                    | Service     |
| -------------------------------------- | ----------- |
| `https://terrakube.localhost`          | UI          |
| `https://terrakube-api.localhost`      | API         |
| `https://terrakube-registry.localhost` | Registry    |
| `https://terrakube-dex.localhost`      | Dex sign-in |

The certificate, private key and root CA are local files. Do not commit them.

### Choose the version and options

Settings are in `docker-compose/.env`. The ones you will most likely change:

| Variable                  | Description                                                                                                                                                              |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `TK_VERSION`              | Terrakube image version for the API, executor, registry and UI. Set it to the release you want to try; the value in the repository can be older than the latest release. |
| `DOMAIN`                  | Base domain, `localhost` by default.                                                                                                                                     |
| `TERRAFORM_LOGIN_ENABLED` | Set to `true` to enable [`terraform login`](/2.34.0/run-terraform/workspaces/cli-driven-workflow.md#terraform-login) through Terrakube.                                  |

Restart with `docker compose up -d --force-recreate` after changing them.

{% hint style="warning" %}
The bundled S3-compatible storage, PostgreSQL, Valkey and LDAP are for local use only, with default passwords.
{% endhint %}

Thanks to [SolomonHD](https://gist.github.com/SolomonHD/b55be40146b7a53b8f26fe244f5be52e) for the original Traefik setup.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.terrakube.io/2.34.0/getting-started/docker-compose.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
