# Install and configure a local deployment

> The options around a local OpenLakeForge deployment: how to install olf, create a project, choose a preset, reach the services over HTTP or HTTPS, and tear…

Source: https://openlakeforge.dev/docs/guides/local-installation/

The options around a local OpenLakeForge deployment: how to install `olf`,
create a project, choose a preset, reach the services over HTTP or HTTPS, and
tear everything down. For the shortest path, follow the
[Quickstart](https://openlakeforge.dev/docs/get-started/quickstart/) instead.

The local platform runs in a [kind](https://kind.sigs.k8s.io/) cluster on your
Docker engine. It does not touch your own `~/.kube/config`, and it is local
evaluation infrastructure: do not expose it beyond your workstation.

## Requirements

| You need | Check |
| --- | --- |
| A running Docker engine | `docker ps` succeeds |
| Python 3.12 or newer, or [uv](https://docs.astral.sh/uv/) | `python3.12 --version` or `uv --version` |
| Ports 80 and 443 free on `127.0.0.1` | Nothing else serves `http://localhost` |

Terraform, Helm, kubectl and kind are not prerequisites: `olf` downloads the
versions pinned in the release and keeps them under `~/.openlakeforge`.

### On WSL2

WSL2 already sets its clock from Windows. If `systemd-timesyncd` also runs, the
two fight and the clock steps back every half minute, which makes Polaris
reject tokens and Trino fail at random with `Not authorized`. Check, and stop
the second service once:

```bash
systemctl is-active systemd-timesyncd   # "active" means it must be stopped
sudo systemctl disable --now systemd-timesyncd
```

`olf infra doctor` reports this as `WSL clock`, and a local deploy warns about
it. See [Trino fails at random with Not authorized on
WSL2](https://openlakeforge.dev/docs/guides/troubleshooting/#trino-fails-at-random-with-not-authorized-on-wsl2).
The step goes away once the platform moves to a Polaris release that tolerates
the skew (#941).

### Hardware

The resources Docker can use, not the whole machine:

| Deployment | CPU | Memory | Free disk |
| --- | --- | --- | --- |
| Slim, one stage (the Quickstart) | 4 | 16 GB | not yet measured; less than Full |
| Full, DEV and PROD | 4 | 16 GB | 100 GB |

These are the tested sizes; smaller machines are untested. The CI Slim smoke test and the nightly Full
DEV+PROD deployment both pass on a GitHub-hosted runner with 4 vCPUs and 16 GB
of memory. With Full and two stages running, the host used about 9 GB of
memory and Docker held about 100 GB: about 15 GB of images and about 84 GB in
the three kind nodes' volumes, which keep a copy of every image. On Docker
Desktop, raise its memory and disk limits to these values.

## Install `olf`

With uv, which fetches Python 3.12 if your machine has none:

```bash
uv tool install "openlakeforge==0.6.0a3" --python 3.12
```

Or with pip, in a virtual environment:

```bash
python3.12 -m venv ~/.venvs/olf
source ~/.venvs/olf/bin/activate
python3.12 -m pip install "openlakeforge==0.6.0a3"
```

With pip, activate the environment again in each new shell. Check the install
with `olf version`.

### Toolchain mode

`OLF_TOOLCHAIN_MODE` decides where `olf` finds Terraform, Helm, kubectl and
kind. Docker is always yours.

| Mode | Behaviour |
| --- | --- |
| `managed` (default) | Downloads and verifies the pinned versions under `~/.openlakeforge`. Never changes your `PATH`. |
| `host` | Uses the tools on your `PATH`, for a machine that cannot download them. |

`OLF_HOME` moves the toolchain, the platform payload and `olf`'s state away
from `~/.openlakeforge`. `olf toolchain list` shows what is installed and
`olf toolchain install` downloads everything in advance.

## Create a project

Run `olf init` in an empty directory:

```bash
mkdir my-lakehouse && cd my-lakehouse
olf init
```

It writes `openlakeforge.yaml`, the Deployment Profile, and `lakehouse_code/`
with three demo data products. The profile enables one DEV stage on the Slim
preset, with plain HTTP and no sign-in. `olf init` refuses to overwrite either.

| Option | Effect |
| --- | --- |
| `--stages dev,prod` | Enable other stages: `dev`, `dev,prod` or `dev,uat,prod`. |
| `--preset full` | Add Superset and OpenMetadata to the Slim data path. |
| `--name <name>` | Name the profile something other than the directory. |
| `--profile-only` | Write only `openlakeforge.yaml`, into an existing project. |
| `--empty` | Skip the demo products. |

An `--empty` project cannot deploy until it holds a source and a product.
Scaffold them first:

```bash
olf source new crm --resource accounts
olf product new sales/accounts_report --input crm/accounts --gold-table mart_accounts
```

## Deploy

```bash
olf infra deploy
```

The first deploy takes several minutes while images download. `olf infra deploy`
runs four phases in order; `--phase` runs one of them:

| Phase | What it does | Rerun it when |
| --- | --- | --- |
| `foundation` | Creates the kind cluster `openlakeforge-local` (one control plane, two workers) | The cluster was deleted |
| `prefetch` | Pulls the large runtime images into the kind nodes | An image pull failed or timed out |
| `platform` | Deploys the shared services and one namespace per stage with Terraform and Helm | You changed the preset or the stages |
| `artifacts` | Builds the project-code image from `lakehouse_code/` and deploys your data products | You changed code under `lakehouse_code/` |

Every phase reconciles what already exists, so running it again is safe.

## Choose Slim or Full

| Preset | Includes |
| --- | --- |
| `slim` (default) | dlt, Floe, Iceberg, Polaris, Trino, dbt and Dagster: the whole ingestion-to-Gold path |
| `full` | Slim plus OpenMetadata (governance, lineage) and Superset (dashboards) |

Set `preset: full` under `spec` in `openlakeforge.yaml` and run
`olf infra deploy` again. The change applies in place: nothing
already deployed is removed. Setting `preset: slim` removes the two services
the same way.

## Local defaults

| Setting | Default | Change it with |
| --- | --- | --- |
| Cluster | `openlakeforge-local` | `--cluster-name` |
| Kube context | `kind-openlakeforge-local` | follows the cluster name |
| Kubeconfig | `~/.openlakeforge/state/local/kubeconfig.yaml` | `--kubeconfig-path` |
| Shared services | namespace `olf-system` | |
| Stage services | namespace `olf-<stage>`, one per enabled stage | `spec.stages` in the profile |
| Stage selected by `olf` commands | `dev` | `--stage` |

In a source checkout of the repository, the kubeconfig is
`.tmp/kubeconfigs/local.yaml` instead.

## Access the services

```bash
olf infra status
```

The `URLs` section lists every service. With the default profile:

| Service | URL |
| --- | --- |
| Portal, linking every service | `http://olf.localhost` |
| Dagster, per stage | `http://dagster-dev.olf.localhost` |
| Trino, per stage | `http://trino-dev.olf.localhost` |
| Superset, per stage (Full) | `http://superset-dev.olf.localhost` |
| OpenMetadata (Full) | `http://openmetadata.olf.localhost` |

Browsers resolve every `*.localhost` name to your machine. Command-line tools
often do not; `olf` pins them itself, and for `curl` pass `--resolve`:

```bash
curl --resolve dagster-dev.olf.localhost:80:127.0.0.1 http://dagster-dev.olf.localhost/server_info
```

With sign-in off, Superset opens as its local Admin and OpenMetadata accepts
`admin@open-metadata.org` with the password in Secret `openmetadata-admin`:

```bash
kubectl -n olf-system get secret openmetadata-admin -o jsonpath='{.data.admin-password}' | base64 -d
```

Over plain HTTP, the Trino Web UI shows a
fixed user, `olf-web`, instead of a login form; per-person identity in the UI
needs HTTPS (#425). To require sign-in, see
[Connect GitHub](https://openlakeforge.dev/docs/guides/identity/connect-github/).

### Serve HTTPS

`spec.access.tls` defaults to `none`, which serves plain HTTP, and `olf init`
writes it out. To serve HTTPS from a local certificate authority (CA), set
`tls: local-ca` and deploy again:

```yaml
spec:
  access:
    tls: local-ca
```

`olf infra deploy` creates the CA once, in the cluster (it is there with plain HTTP
too, for the pods that call Trino over HTTPS). Your browser rejects the
routes until it trusts that CA. Export it and print the trust commands for
your system:

```bash
olf infra access trust
```

It writes `openlakeforge-local-ca.crt` and prints the commands for Linux,
macOS or WSL2; each needs your own privileges, so `olf` prints rather than runs
them. Firefox keeps its own store: Settings, Privacy & Security, View
Certificates, Authorities, Import. On WSL2 the CA must go into the Windows
store, because the browser runs on Windows.

### Reach Polaris and SeaweedFS

Polaris and SeaweedFS have no route. `olf infra forward` port-forwards every service
to fixed ports on `localhost` until you press Ctrl-C:

```bash
olf infra forward
```

| Port | Service |
| ---: | --- |
| 3000 | Dagster |
| 8080 | Trino |
| 8088 | Superset (Full) |
| 8181 | Polaris API |
| 8585 | OpenMetadata (Full) |
| 8888 | SeaweedFS Filer UI |
| 9000 | SeaweedFS S3 API |
| 9333 | SeaweedFS Master UI |

`OLF_PORT_FORWARD=1` makes `olf`'s own commands, such as `olf infra e2e run`,
port-forward instead of using the ingress, for example while you debug it.

## Try a portal preview image

To test a portal change before it is released, deploy a preview image published
by the portal repository's CI for a pull request. The portal is deployed only
when the profile has `spec.access`. The image replaces the pinned portal image
until you deploy again without it.

1. Take the preview image's digest from the portal pull request.
2. Write `portal-preview.tfvars` in the project root, with `<N>` the pull
   request number and `<digest>` the 64 hex digits after `sha256:`:

   ```hcl
   portal_image = "ghcr.io/openlakeforge/openlakeforge-portal:pr-<N>@sha256:<digest>"
   ```

3. Deploy with the file:

   ```bash
   olf infra deploy --var-file portal-preview.tfvars
   ```

4. To go back to the pinned image, deploy without the file:

   ```bash
   olf infra deploy
   ```

The reference must be pinned by digest, or Terraform refuses the plan. `olf`
does not prefetch this image: the kind nodes pull it from the registry.

## Tear down

```bash
olf infra destroy
```

It destroys the platform services, then the kind cluster. The cluster holds
all state, so this deletes your Bronze, Silver and Gold data and Dagster's run
history. `openlakeforge.yaml` and `lakehouse_code/` are not touched, and the
next `olf infra deploy` rebuilds the same platform from them. With HTTPS, a rebuilt
cluster has a new CA: run `olf infra access trust` again.

| To remove | Run |
| --- | --- |
| Only the platform, keeping the cluster | `olf infra destroy --phase platform` |
| Only the cluster, after the platform | `olf infra destroy --phase foundation` |
| The managed toolchain under `~/.openlakeforge` | `olf toolchain clean --all` |

`--phase foundation` refuses to run while platform namespaces exist; `--force`
overrides that and loses them. After `--phase platform`, bring the platform
back with `olf infra deploy --phase platform`, then
`--phase artifacts`.

## Contributor checkout

To work on OpenLakeForge itself, clone the repository and run the same
commands through uv from its root:

```bash
git clone https://github.com/OpenLakeForge/openlakeforge.git
cd openlakeforge
uv run --project tools/olf --locked olf infra deploy
```

The contributor workflow and its gates are in
[AGENTS.md](https://github.com/OpenLakeForge/openlakeforge/blob/v0.6.0-alpha.3/AGENTS.md).

## Check it worked

```bash
olf infra e2e run --env local --suite full
```

It launches every product's job and checks the Silver and Gold tables through
Trino; on Full it also checks Superset and OpenMetadata. It ends with
`Local OpenLakeForge full e2e validation passed.`

---

<small>Synced from openlakeforge @ `v0.6.0-alpha.3` (`882b426`), [docs/guides/local-installation.md](https://github.com/OpenLakeForge/openlakeforge/blob/882b426992381ef277f7c0830f36c0d6fa348644/docs/guides/local-installation.md).</small>
