Skip to content

Installation

FlagBridge can be deployed in three ways: self-hosted via Docker, on FlagBridge Cloud (SaaS), or on Kubernetes with the official Helm chart.

Self-hosted (Docker Compose)

The simplest self-hosted setup uses Docker Compose with PostgreSQL.

yaml
# docker-compose.yml
services:
  flagbridge:
    image: ghcr.io/flagbridge/flagbridge:latest
    ports:
      - "8080:8080"
    environment:
      DATABASE_URL: postgres://flagbridge:secret@db:5432/flagbridge
      SECRET_KEY: change-me-in-production
      # Optional: Redis for distributed evaluation cache
      # REDIS_URL: redis://redis:6379
    depends_on:
      db:
        condition: service_healthy
    restart: unless-stopped

  db:
    image: postgres:16-alpine
    volumes:
      - postgres_data:/var/lib/postgresql/data
    environment:
      POSTGRES_USER: flagbridge
      POSTGRES_PASSWORD: secret
      POSTGRES_DB: flagbridge
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U flagbridge"]
      interval: 5s
      timeout: 5s
      retries: 5
    restart: unless-stopped

volumes:
  postgres_data:
bash
docker compose up -d

# Run database migrations
docker compose exec flagbridge flagbridge migrate

# Check that it's running
curl http://localhost:8080/health

WARNING

Change SECRET_KEY before deploying to production. Use a cryptographically random string of at least 32 characters.

Environment variables

VariableRequiredDefaultDescription
DATABASE_URLYesPostgreSQL connection string
SECRET_KEYYesSecret for signing tokens
PORTNo8080HTTP port to listen on
REDIS_URLNoRedis URL for distributed cache
LOG_LEVELNoinfoLog level (debug, info, warn, error)
LOG_FORMATNojsonLog format (json, text)
CORS_ORIGINSNo*Allowed CORS origins (comma-separated)
MAX_CONNECTIONSNo25Max PostgreSQL connections

Kubernetes (Helm) CE

Install with the official Helm chart:

bash
helm repo add flagbridge https://charts.flagbridge.io
helm repo update

# Create a values file
cat > flagbridge-values.yaml <<EOF
image:
  tag: latest

config:
  secretKey: "change-me-in-production"

postgresql:
  enabled: true
  auth:
    password: "change-me"

ingress:
  enabled: true
  className: nginx
  hosts:
    - host: flags.example.com
      paths:
        - path: /
          pathType: Prefix
EOF

helm install flagbridge flagbridge/flagbridge \
  --namespace flagbridge \
  --create-namespace \
  -f flagbridge-values.yaml

Using an external database

yaml
# flagbridge-values.yaml
postgresql:
  enabled: false

config:
  databaseUrl: "postgres://user:pass@your-db-host:5432/flagbridge"
  secretKey: "change-me-in-production"

High availability

yaml
replicaCount: 3

autoscaling:
  enabled: true
  minReplicas: 2
  maxReplicas: 10
  targetCPUUtilizationPercentage: 70

redis:
  enabled: true

See the Helm chart reference for all available values.

FlagBridge Cloud (SaaS)

FlagBridge Cloud is the fully managed option — no infrastructure to maintain.

  1. Sign up at app.flagbridge.io
  2. Create a project
  3. Copy your API key
  4. Point your SDK to https://api.flagbridge.io

INFO

FlagBridge Cloud uses the same open-source core. Your data stays in your region.

Upgrading

bash
# Docker Compose
docker compose pull
docker compose up -d

# Run any new migrations
docker compose exec flagbridge flagbridge migrate
bash
# Helm
helm repo update
helm upgrade flagbridge flagbridge/flagbridge -f flagbridge-values.yaml