---
title: "Kubernetes Deployment"
description: "Deploy Formbricks on Kubernetes with the current OCI Helm chart."
icon: "circle-nodes"
---

Deploy Formbricks on Kubernetes using the current OCI Helm chart published from the `charts/formbricks`
directory in the Formbricks repository.

See [deployment components](/self-hosting/deployment-components) for required services, managed alternatives
and the release-specific image inventory.

<Info>
  Formbricks self-hosting requires Hub to be part of the runtime. The chart handles that by default. Use the
  [migration guide](/self-hosting/advanced/migration#v5) before upgrading an existing 4.x deployment.
</Info>

## Prerequisites

Ensure you have the following before proceeding:

- a running Kubernetes cluster
- Helm 3 installed locally
- a public hostname for `formbricks.webappUrl`
- a plan for PostgreSQL and Redis/Valkey, either in-cluster or managed externally
- an edge rate-limiting plan for the v5-covered routes: the chart's Envoy bundle or an equivalent external edge
  solution

## 1. Install The Chart

<Steps>
  <Step title="Create A Minimal values.yaml">

```yaml
formbricks:
  webappUrl: https://surveys.example.com
```

    Add any additional overrides you need for ingress, external services, secrets, or Enterprise license features.

  </Step>

  <Step title="Install Formbricks">

```sh
helm install formbricks oci://ghcr.io/formbricks/helm-charts/formbricks \
  -n formbricks \
  --create-namespace \
  -f values.yaml
```

    By default, the chart deploys:

    - the Formbricks application
    - Formbricks Hub API and worker
    - SpiceDB and its operator
    - Cube
    - PostgreSQL
    - Redis
    - generated Kubernetes Secrets

  </Step>
</Steps>

<Warning>
  The default values are a starting point, not a production edge or high-availability configuration. Both
  `ingress.enabled` and `envoy.enabled` default to `false`, so the chart does not expose the application or add
  the v5 edge rate limits unless you configure them. The defaults also combine `autoscaling.minReplicas: 1` with
  `pdb.minAvailable: 1`; that PodDisruptionBudget can block a node drain because Kubernetes cannot voluntarily
  evict the only app pod.
</Warning>

## 2. Configure Secrets And External Services

### Using Generated Secrets

The default chart path keeps `secret.enabled: true`, which lets the chart generate the required application
secrets for you.

### Adding An Enterprise License

There is no separate `enterprise.enabled` switch. Enterprise features are unlocked by a valid
`ENTERPRISE_LICENSE_KEY`. For a quick-start deployment that uses the chart-generated app Secret, set:

```yaml
enterprise:
  licenseKey: your-enterprise-license-key
```

For production, keep the license out of a values file and provide `ENTERPRISE_LICENSE_KEY` through your existing
Secret or ExternalSecret instead. The `enterprise.licenseKey` chart value only writes to the generated app Secret
when `secret.enabled: true`.

### Using Managed PostgreSQL And Redis

For production workloads, many teams prefer managed services:

```yaml
postgresql:
  enabled: false
  externalDatabaseUrl: "postgresql://user:password@your-postgres-host:5432/formbricks"

redis:
  enabled: false
  externalRedisUrl: "redis://your-redis-host:6379"

# Cube cannot read DATABASE_URL. With the bundled PostgreSQL the chart connects it for you;
# with an external database, set its connection here.
cube:
  env:
    CUBEJS_DB_HOST: your-postgres-host
    CUBEJS_DB_PORT: "5432"
    CUBEJS_DB_NAME: formbricks
    CUBEJS_DB_USER: user
    CUBEJS_DB_SSL: "true" # when your server requires TLS
    CUBEJS_DB_PASS:
      valueFrom:
        secretKeyRef:
          name: formbricks-cube-db # a Secret you create
          key: password
```

### Using External Secrets

If your cluster already uses an external secret manager, enable `externalSecret` and point it at your existing
SecretStore. Ensure the resulting app secret exposes the values your deployment needs, including `DATABASE_URL`,
`REDIS_URL`, and `HUB_API_KEY`.

### SpiceDB authorization

Formbricks v6 uses SpiceDB, maintained by AuthZed, as its authorization engine. Fresh chart installations
enable a private, two-replica SpiceDB cluster and `fully_consistent` decisions by default. If the cluster already
has a compatible SpiceDB operator, keep the authorization runtime enabled but disable this release's operator
installation:

```yaml
authzed:
  operator:
    install: false
```

The default `authzed.operator.install: true` installs the pinned operator, creates the cluster, and bootstraps a
dedicated `spicedb` database and login. Install only one operator in a Kubernetes cluster.

For managed PostgreSQL, create a separate SpiceDB database and login first. Store its connection URI and a
strong API token in a Kubernetes Secret using the keys `datastore_uri` and `preshared_key`, then configure:

```yaml
authzed:
  enabled: true
  auth:
    existingSecret: formbricks-authzed
  datastore:
    existingSecret: formbricks-authzed
```

Use `authzed.mode: external`, `authzed.operator.install: false`, `authzed.endpoint: <host>:<port>`, and
`authzed.insecure: false` when connecting
to an externally managed AuthZed endpoint. The external endpoint must serve TLS because the preshared token is
sent on every authenticated request. The application endpoint remains internal and uses plaintext gRPC by
default when the chart owns SpiceDB.

For an already-running v6 installation, Helm prints release-specific diagnostic commands that execute the
release-matched operator CLI inside a Formbricks pod:

```bash
kubectl exec -n <namespace> deployment/formbricks -- formbricks-authzed health
kubectl exec -n <namespace> deployment/formbricks -- formbricks-authzed schema check
kubectl exec -n <namespace> deployment/formbricks -- formbricks-authzed upgrade check
```

A fresh install runs an idempotent initialization Job, but application startup and probes remain independent
from it. Upgrades never run relationship preparation automatically. For an existing v5 installation, follow
[the v6 upgrade procedure below](#upgrading-from-v5-to-v6) before running `helm upgrade` or resuming GitOps.
The chart refuses an unacknowledged upgrade, disabled AuthZed, or weaker consistency. Follow
[AuthZed Operations](/self-hosting/configuration/authzed-operations) for ongoing operations and do not expose SpiceDB
through an Ingress.

<span id="3-v5-specific-deployment-notes" />

## 3. Deployment options

### Hub Is Mandatory

Formbricks does not support `hub.enabled=false`. Keep the default `hub.enabled=true` behavior in place.

Use `hub.image.tag`, `hub.resources`, and `hub.existingSecret` only when you need to pin or customize the Hub
deployment details.

<span id="envoy-bundle-modes" />

### Envoy CRD ownership

Choose the controller and CRD owners before enabling Envoy. Follow [Envoy Gateway](/self-hosting/configuration/envoy)
for bundled, platform-managed and shared-controller setups, including Redis, preflight checks and GitOps ordering.

### Production Replicas And Disruption Budgets

For a production deployment that should remain available during a voluntary disruption, run at least two app
replicas:

```yaml
autoscaling:
  enabled: true
  minReplicas: 2

pdb:
  enabled: true
  minAvailable: 1
```

If you intentionally run a single app replica, either disable the PDB or use `maxUnavailable: 1` instead of
`minAvailable` and accept downtime during the eviction. Never set both fields; set the unused field to `null` in
your values file.

Two autoscaling defaults are easy to miss:

- **`maxReplicas: 10` can exceed what the node pool can hold.** Each app pod requests 1 vCPU, so the ceiling
  needs about 10 allocatable vCPU for the app alone, on top of the platform reserve and the Hub, Cube and
  SpiceDB pods. A smaller pool leaves the extra replicas `Pending` — an HPA does not lower its own ceiling.
- **The HPA scales on CPU and memory utilization only.** Queue depth is not one of its metrics, so a job
  backlog can grow while both targets sit under their thresholds and no replica is added. Backlog-driven
  scaling needs a queue-depth metric published to the metrics API and added to the HPA yourself.

### Cube

Cube is part of the baseline Formbricks v5 stack and is bundled with the chart by default
(`cube.enabled: true`). To run an external Cube cluster instead:

- set `cube.enabled: false` to skip the bundled Cube deployment
- point the app at your external endpoint via `deployment.env.CUBEJS_API_URL`
- supply `CUBEJS_API_SECRET` via `deployment.env` or `deployment.envFrom` if you disable generated
  secrets

<span id="optional-ai-taxonomy-beta" />
<span id="optional-bundled-qwen/vllm-for-ai" />

### Optional AI services

See [AI deployment options](/self-hosting/configuration/ai-deployment) for this deployment method,
and [AI configuration](/self-hosting/configuration/ai-features) for providers and credentials.

## 4. Upgrade the deployment

Use [Upgrade Kubernetes](/self-hosting/upgrade/kubernetes) for the ordered Helm and GitOps procedure.

### Upgrading from v5 to v6

Complete the [6.0 prerequisites](/self-hosting/upgrade/versions/6.0), then follow the same deployment procedure.

### Later chart upgrades

Start with [Upgrade Formbricks](/self-hosting/advanced/upgrade), then follow the [Kubernetes runbook](/self-hosting/upgrade/kubernetes).
Since 4.0, each release publishes a chart with the same version number as the app.

## 5. Key Values

| Field                            | Description                                                    |
| -------------------------------- | -------------------------------------------------------------- |
| `formbricks.webappUrl`           | Public base URL for the Formbricks app                         |
| `deployment.image.tag`           | Formbricks image tag override                                  |
| `hub.enabled`                    | Keep `true`                              |
| `hub.image.tag`                  | Hub image tag override                                         |
| `envoy.enabled`                  | Enables chart-managed Envoy Gateway resources                  |
| `envoy.controller.enabled`       | Installs the bundled Envoy controller when `true`              |
| `envoyRedis.enabled`             | Deploys a dedicated Redis backend for Envoy rate limiting      |
| `llm.enabled`                    | Deploys the optional bundled Qwen/vLLM runtime                 |
| `llm.autoConfigureApp`           | Injects Formbricks OpenAI-compatible env vars for bundled Qwen |
| `taxonomy.enabled`               | Deploys the optional standalone AI taxonomy service            |
| `postgresql.externalDatabaseUrl` | Uses an external PostgreSQL service instead of in-cluster      |
| `redis.externalRedisUrl`         | Uses an external Redis/Valkey service instead of in-cluster    |

For the complete values surface, refer to the chart README in the repository:
[charts/formbricks/README.md](https://github.com/formbricks/formbricks/tree/main/charts/formbricks).

## Verify the installation

Run the [deployment check](/self-hosting/setup/deployment-check) in a dedicated workspace before collecting real responses.

## 6. Uninstalling The Deployment

To remove the deployment:

```sh
helm uninstall formbricks -n formbricks
```

If you also want to remove in-cluster persistent volumes:

```sh
kubectl delete pvc --all -n formbricks
```
