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

# Helm Deployment

> Deploy Context7 On-Premise on Kubernetes with the Helm chart

The Context7 Helm chart is the turnkey way to run Context7 On-Premise on Kubernetes. It renders a single-replica StatefulSet by default and switches to a multi-replica Deployment when you enable scaling, so the same chart covers both the standard install and horizontal scaling. The chart is published to `oci://ghcr.io/context7/charts`, so no repository setup is needed — `helm install` pulls it directly.

This guide assumes you have completed the [On-Premise setup](https://context7.com/docs/enterprise/on-premise.md) and have a valid license key.

## Prerequisites

* A Kubernetes cluster (v1.24+) and `helm` (v3+).
* A Context7 license key.
* An image pull secret for `ghcr.io`. Create it with the steps in [Registry Authentication](https://context7.com/docs/enterprise/deployment/kubernetes.md#registry-authentication), which produces a `context7-registry` secret in the `context7` namespace.

## Single container (default)

Runs one replica with the embedded database on a persistent volume. Nothing external is required.

```bash theme={null}
helm install context7 oci://ghcr.io/context7/charts/context7-enterprise \
  --namespace context7 --create-namespace \
  --set license=ctx7sk-... \
  --set 'imagePullSecrets[0].name=context7-registry'
```

Reach the UI to finish setup:

```bash theme={null}
kubectl -n context7 port-forward svc/context7-context7-enterprise 3000:3000
```

Then open `http://localhost:3000`.

## Multiple replicas

Provision an external PostgreSQL with the `pgvector` extension first (relational data and embeddings both live there, no object storage needed). See [Scaling](https://context7.com/docs/enterprise/deployment/scaling.md) for the architecture and how to provision pgvector.

```bash theme={null}
helm install context7 oci://ghcr.io/context7/charts/context7-enterprise \
  --namespace context7 --create-namespace \
  --set license=ctx7sk-... \
  --set 'imagePullSecrets[0].name=context7-registry' \
  --set scaling.enabled=true \
  --set scaling.replicas=3 \
  --set scaling.databaseUrl='postgres://user:pass@host:5432/context7' \
  --set scaling.encryptionKey=$(openssl rand -hex 32)
```

> [!NOTE]
>
> `encryptionKey` is the one shared secret every replica needs. It decrypts stored credentials and signs session tokens, so keep it identical across replicas and stable over time. If it changes, stored credentials can no longer be decrypted and all sessions are invalidated.

With `scaling.enabled=true` the chart runs a Deployment of stateless replicas whose readiness gates on `/api/ready`, so a pod only receives traffic once it has connected to Postgres.

## Ingress

Expose the service through an Ingress instead of port-forwarding:

```bash theme={null}
helm upgrade context7 oci://ghcr.io/context7/charts/context7-enterprise --namespace context7 --reuse-values \
  --set ingress.enabled=true \
  --set ingress.className=nginx \
  --set ingress.host=context7.internal.example.com \
  --set ingress.tls.enabled=true \
  --set ingress.tls.secretName=context7-tls
```

## Migrating an existing single-container install

To move an existing single-container deployment onto Postgres, the chart runs a one-shot migration Job that copies your SQLite data (and the LanceDB index into pgvector) from the volume your container used.

**1. Get your existing encryption key**

Stored credentials are encrypted with the key of the single container, so the new deployment must use the same key. If you did not set `ENCRYPTION_KEY` yourself, the container created the key in its data volume:

```bash theme={null}
kubectl exec -n context7 context7-0 -- cat /data/.encryption-key
```

For an install from this chart, the pod is `context7-context7-enterprise-0`. Use this value as `scaling.encryptionKey` below.

**2. Point the Job at your existing data**

Set `migration.enabled=true` and `migration.dataPvcName` to the PVC that holds your existing `/data`. Find it with `kubectl get pvc -n context7`: an install from the [Kubernetes guide](https://context7.com/docs/enterprise/deployment/kubernetes.md) uses `data-context7-0`, and an install from this chart uses `data-<release>-context7-enterprise-0` (for example `data-context7-context7-enterprise-0`).

If your existing install used this chart, upgrade the release:

```bash theme={null}
helm upgrade context7 oci://ghcr.io/context7/charts/context7-enterprise --namespace context7 --reuse-values \
  --set scaling.enabled=true \
  --set scaling.databaseUrl='postgres://user:pass@host:5432/context7' \
  --set scaling.encryptionKey='<your-existing-key>' \
  --set migration.enabled=true \
  --set migration.dataPvcName=data-context7-context7-enterprise-0
```

If you installed with the Kubernetes guide, there is no Helm release yet. Delete the old StatefulSet first so the Job can mount its volume (the PVC stays), then install the chart:

```bash theme={null}
kubectl delete statefulset context7 -n context7
helm install context7 oci://ghcr.io/context7/charts/context7-enterprise \
  --namespace context7 \
  --set license=ctx7sk-... \
  --set 'imagePullSecrets[0].name=context7-registry' \
  --set scaling.enabled=true \
  --set scaling.databaseUrl='postgres://user:pass@host:5432/context7' \
  --set scaling.encryptionKey='<your-existing-key>' \
  --set migration.enabled=true \
  --set migration.dataPvcName=data-context7-0
```

**3. Turn the Job off after it completes**

Once the Job reports success, disable it so it does not run again on the next upgrade.

```bash theme={null}
helm upgrade context7 oci://ghcr.io/context7/charts/context7-enterprise --namespace context7 --reuse-values \
  --set migration.enabled=false
```

See [Migrating an existing deployment](https://context7.com/docs/enterprise/deployment/scaling.md#migrating-an-existing-deployment) for what the migration copies and how to verify it.

## Values

| Value | Default | Description |
| - | - | - |
| `license` | `""` | Context7 license key. Required. |
| `imagePullSecrets` | `[]` | Pull secrets for `ghcr.io`, for example `context7-registry`. |
| `serviceAccountName` | `""` | Kubernetes service account for the pods, for example one bound to [GKE Workload Identity](https://context7.com/docs/enterprise/integrations/google-vertex-ai.md) or to an IAM role for Bedrock. Empty uses the namespace's default service account. |
| `scaling.enabled` | `false` | `false` runs a single-replica StatefulSet; `true` runs a multi-replica Deployment. |
| `scaling.replicas` | `3` | Replica count when scaling is enabled. |
| `scaling.databaseUrl` | `""` | External Postgres (with pgvector). Required when scaling is enabled. |
| `scaling.encryptionKey` | `""` | Shared secret, identical across replicas. Required when scaling is enabled. |
| `persistence.storage` | `10Gi` | Volume size for the single-replica default. |
| `persistence.storageClass` | `""` | StorageClass for the single-replica volume. |
| `ingress.enabled` | `false` | Create an Ingress for the service. |
| `resources` | `1-4 CPU / 2-8Gi` | Pod resource requests and limits. |
| `env` | `[]` | Extra environment variables, for example `AWS_REGION` and workload credentials for Bedrock, `GOOGLE_CLOUD_PROJECT` for Vertex AI, `HTTPS_PROXY` and `NO_PROXY` for an [egress proxy](https://context7.com/docs/enterprise/deployment/docker.md#egress-proxy), `NODE_EXTRA_CA_CERTS`, or `CONTEXT7_API_URL`. |
| `migration.enabled` | `false` | Run the one-shot SQLite to Postgres migration Job. |
| `migration.dataPvcName` | `""` | PVC holding the existing `/data` to migrate from. |

AI provider keys and Git credentials are configured in the UI after first boot. There are no environment variables for them.


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