# Operator Setup

Source: https://docs.formance.com/v4.0/deploy/self-hosted/installation/operator-setup

Stack: v4.0

Install Formance on Kubernetes using the unified Formance Helm chart. The commands below use a matching set of chart and CRD versions. For an existing deployment, follow [Upgrade the Operator and modules](https://docs.formance.com/v4.0/manage/upgrade/from-operator).

Applies to: license=ee.

Enterprise Edition requires a valid license. Contact <sales@formance.com> to obtain one.

## Prerequisites

Before you begin, ensure you have:

- Kubernetes 1.30+ cluster
- Helm 3.x installed
- `kubectl` configured to access your cluster
- An Ingress Controller (nginx, traefik, etc.)

Applies to: license=ee.

- SSL certificates for your domain
- **Enterprise Edition license** (Cluster ID and License Token)

For detailed requirements, see the [Requirements](https://docs.formance.com/v4.0/deploy/self-hosted/requirements) page.

## Install the CRDs

For a **new installation**, install the Custom Resource Definitions (CRDs) first:

```bash
helm upgrade --install operator-crds oci://ghcr.io/formancehq/helm/operator-crds \
  --version {{infra.operator-crds-version}} \
  --namespace formance-system \
  --create-namespace

kubectl wait --for condition=established --timeout=60s crd/versions.formance.com
```

The install commands below disable bundled CRDs because this separate release owns them. If CRDs already exist, follow the [upgrade procedure](https://docs.formance.com/v4.0/manage/upgrade/from-operator#upgrade-your-existing-installation) to preserve their owner.

## Quick Start

oss:

Install Community Edition using the CRDs prepared above:

```bash
helm upgrade --install formance {{infra.helm-chart-url}} \
  --version {{infra.helm-chart-version}} \
  --namespace formance-system \
  --set regions.operator.operator-crds.create=false \
  --create-namespace
```

This installs the Operator and a bundled PostgreSQL instance for evaluation. For production, configure [PostgreSQL](https://docs.formance.com/v4.0/deploy/self-hosted/infrastructure/postgresql) in a values file and add `--values values.yaml` to the command.

ee:

Prepare the license, domain, and Membership keys before running the install command.

### Set Environment Variables

```bash
export CLUSTER_ID=$(kubectl get ns kube-system -o jsonpath='{.metadata.uid}')
export LICENCE_TOKEN="your-licence-token"
export BASE_DOMAIN="formance.example.com"
```

### Prepare the Membership signing and crypto keys

The Operator provisions [stack Auth keys](https://docs.formance.com/v4.0/deploy/self-hosted/modules/auth#signing-keys) automatically. Membership is a separate control-plane service: follow [Membership keys](https://docs.formance.com/v4.0/deploy/self-hosted/installation/control-plane#membership-signing-and-crypto-keys) to prepare its signing and crypto keys and the `values.yaml` that references them before installing Enterprise Edition.

For production or shared environments, also replace the chart's evaluation credentials in this values file before installing. Follow [Replace Default Secrets Before Production](https://docs.formance.com/v4.0/deploy/self-hosted/installation/control-plane#replace-default-secrets-before-production) and configure your [PostgreSQL connection](https://docs.formance.com/v4.0/deploy/self-hosted/infrastructure/postgresql).

### Install

```bash
helm upgrade --install formance {{infra.helm-chart-url}} \
  --version {{infra.helm-chart-version}} \
  --namespace formance-system \
  --set regions.operator.operator-crds.create=false \
  --create-namespace \
  --set tags.EnterpriseEdition=true \
  --values values.yaml \
  --set global.licence.clusterID=$CLUSTER_ID \
  --set global.licence.token=$LICENCE_TOKEN \
  --set global.serviceHost=$BASE_DOMAIN
```

### Configure Service Hosts

The command sets `global.serviceHost` to your base domain. Continue with [Control Plane Setup](https://docs.formance.com/v4.0/deploy/self-hosted/installation/control-plane) to configure service access and your identity provider.

## Using Minimal Profile

For evaluation with reduced resource requirements, download the minimal profile for your edition. These profiles match the chart version used above:

- [Community Edition](https://raw.githubusercontent.com/formancehq/helm/formance-3.13.1/charts/formance/profiles/ce-minimal.yaml)
- [Enterprise Edition](https://raw.githubusercontent.com/formancehq/helm/formance-3.13.1/charts/formance/profiles/ee-minimal.yaml)

Save the profile locally and add `--values /path/to/profile.yaml` to your install command. Place it **before** your own `--values values.yaml` so your configuration takes precedence. Keep the version, CRD, and Enterprise settings from the command above.

## Custom Configuration

### Using a Values File

oss:

Create a custom `values.yaml` to configure the platform:

```yaml
# values.yaml
postgresql:
  enabled: false  # Disable bundled PostgreSQL

global:
  postgresql:
    host: "my-postgres.example.com"
    additionalArgs: "sslmode=require"
    auth:
      username: "formance"
      password: "your-secure-password"
      database: "formance"

regions:
  operator:
    enabled: true
  versions:
    create: true
  settings:
    postgres-uri:
      key: "postgres.*.uri"
      value: "postgresql://formance:your-secure-password@my-postgres.example.com:5432?disableSSLMode=true"
```

ee:

Keep your Membership signing and crypto key references and production configuration in the same `values.yaml` used by the install command. The [control-plane guide](https://docs.formance.com/v4.0/deploy/self-hosted/installation/control-plane) covers credentials, identity providers, and service configuration.

### View All Configuration Options

```bash
helm show values {{infra.helm-chart-url}} --version {{infra.helm-chart-version}}
```

## Verify Installation

Check that all components are running:

```bash
kubectl get pods -n formance-system
```

Verify that the Operator is ready. Pod names depend on your Helm release and configuration.

Applies to: license=ee.

Also check Membership, Console, and your configured identity provider. Complete [Control Plane Setup](https://docs.formance.com/v4.0/deploy/self-hosted/installation/control-plane) and test sign-in before making the environment available to users.

Applies to: license=ee.

## License Validation

The chart enforces license validation when `tags.EnterpriseEdition` is `true`:

- Installation will **fail** if `global.licence.clusterID` is missing
- Installation will **fail** if `global.licence.token` is missing

Get your Cluster ID with: `kubectl get ns kube-system -o jsonpath='{.metadata.uid}'`

## Troubleshooting

### `no matches for kind "Versions" in version "formance.com/v1beta1"`

The chart tried to create a `Versions` resource before its CRD was registered. Follow [Install the CRDs](#install-the-crds), then confirm that `versions.formance.com` is established before retrying. For existing CRDs, use the [upgrade procedure](https://docs.formance.com/v4.0/manage/upgrade/from-operator#upgrade-your-existing-installation) instead of creating a second owner.

## Next Steps

After installing the operator:

1. Configure your [Infrastructure Services](https://docs.formance.com/v4.0/deploy/self-hosted/infrastructure/postgresql) (PostgreSQL, Message Broker)
2. Deploy your first [Stack](https://docs.formance.com/v4.0/deploy/self-hosted/modules/stack)
3. Enable the modules you need

Applies to: license=ee.

4. [Configure the Control Plane](https://docs.formance.com/v4.0/deploy/self-hosted/installation/control-plane) — Set up Dex, create organizations, and configure SSO
