Deploying Formbricks on Kubernetes

This guide explains how to deploy Formbricks on a Kubernetes cluster using Helm. It assumes that:

  • You already have a Kubernetes cluster running (e.g., DigitalOcean, GKE, AWS, Minikube).
  • An Ingress controller (e.g., Traefik, Nginx) is configured.
  • You have Helm installed on your local machine.

🚀 Step 1: Install Formbricks with Helm

1️⃣ Clone the Formbricks Helm Chart

git clone https://github.com/formbricks/formbricks.git
cd formbricks/helm-chart

2️⃣ Deploy Formbricks

 helm install my-formbricks ./ \
  --namespace formbricks \
  --create-namespace \
  --set replicaCount=2

🎯 Step 2: Verify and Access Formbricks

Check the Running Services

kubectl get pods -n formbricks
kubectl get svc -n formbricks
kubectl get ingress -n formbricks

Access Formbricks

  • If running locally with Minikube:
    minikube service my-formbricks -n formbricks
    
  • If deployed on a cloud cluster, visit:
    https://formbricks.example.com
    

Upgrading Formbricks

This section provides guidance on how to upgrade your Formbricks deployment using Helm, including examples of common upgrade scenarios.

Upgrade Process

To upgrade your Formbricks deployment when using a local chart (e.g., with Minikube), use:

# From the helm-chart directory
helm upgrade my-formbricks ./ --namespace formbricks

For installations from the Helm repository (typically for production deployments):

helm repo update
helm upgrade my-formbricks formbricks/formbricks --namespace formbricks

Common Upgrade Scenarios

1. Updating Environment Variables

To update or add new environment variables, use the --set flag with the env prefix:

helm upgrade my-formbricks formbricks/formbricks \
  --set env.SMTP_HOST=new-smtp.example.com \
  --set env.SMTP_PORT=587 \
  --set env.NEW_CUSTOM_VAR=newvalue

This command updates the SMTP host and port, and adds a new custom environment variable.

2. Enabling or Disabling Features

You can enable or disable features by updating their respective values:

# Disable Redis
helm upgrade my-formbricks formbricks/formbricks --set redis.enabled=false

# Enable Redis
helm upgrade my-formbricks formbricks/formbricks --set redis.enabled=true

3. Scaling Resources

To adjust resource allocation:

helm upgrade my-formbricks formbricks/formbricks \
  --set resources.limits.cpu=1 \
  --set resources.limits.memory=2Gi \
  --set resources.requests.cpu=500m \
  --set resources.requests.memory=1Gi

4. Updating Autoscaling Configuration

To modify autoscaling settings:

helm upgrade my-formbricks formbricks/formbricks \
  --set autoscaling.minReplicas=3 \
  --set autoscaling.maxReplicas=10 \
  --set autoscaling.metrics[0].resource.target.averageUtilization=75

5. Changing Database Credentials

To update PostgreSQL database credentials: To switch from the built-in PostgreSQL to an external database or update the external database credentials:

helm upgrade my-formbricks formbricks/formbricks \
  --set postgresql.enabled=false \
  --set postgresql.externalUrl="postgresql://newuser:newpassword@external-postgres-host:5432/newdatabase"

This command disables the built-in PostgreSQL and configures Formbricks to use an external PostgreSQL database. Make sure your external database is set up and accessible before making this change.

Full Values Documentation

Below is a comprehensive list of all configurable values in the Formbricks Helm chart:

FieldDescriptionDefault
image.repositoryDocker image repository for Formbricksghcr.io/formbricks/formbricks
image.pullPolicyImage pull policyIfNotPresent
image.tagDocker image tag"2.6.0"
service.typeKubernetes service typeClusterIP
service.portKubernetes service port80
service.targetPortContainer port to expose3000
resources.limits.cpuCPU resource limit500m
resources.limits.memoryMemory resource limit1Gi
resources.requests.cpuMemory resource requestnull
resources.requests.memoryMemory resource requestnull
autoscaling.enabledEnable autoscalingfalse
autoscaling.minReplicasMinimum number of replicas1
autoscaling.maxReplicasMaximum number of replicas5
autoscaling.metrics[0].typeType of metric for autoscalingResource
autoscaling.metrics[0].resource.nameResource name for autoscaling metriccpu
autoscaling.metrics[0].resource.target.typeTarget type for autoscalingUtilization
autoscaling.metrics[0].resource.target.averageUtilizationAverage utilization target for autoscaling80

Was this page helpful?