{
  "id": "keycloak-postgres",
  "name": "Keycloak (Postgres)",
  "slogan": "Keycloak backed by Postgres instead of its default embedded database, for a real multi-instance setup.",
  "category": "Security",
  "categorySlug": "security",
  "tags": [
    "postgres",
    "multi-service"
  ],
  "license": {
    "spdx": "Apache-2.0",
    "class": "permissive"
  },
  "memoryMiB": 1024,
  "architectures": {
    "amd64": "published",
    "arm64": "published"
  },
  "trust": "listed",
  "verified": false,
  "status": "active",
  "installCommand": "levelrail-cli templates install keycloak-postgres --name my-keycloak-postgres",
  "deployFormats": [
    "cli",
    "api"
  ],
  "url": "https://levelrail.com/templates/keycloak-postgres/",
  "docsUrl": "https://www.keycloak.org/documentation",
  "sourceRepo": "https://github.com/keycloak/keycloak",
  "markdownUrl": "https://levelrail.com/templates/keycloak-postgres.md",
  "jsonUrl": "https://levelrail.com/templates/keycloak-postgres.json",
  "indexable": true,
  "description": "Keycloak backed by Postgres instead of its default embedded database, for a real multi-instance setup. Runs 2 containers (db, keycloak), with keycloak listening on port 8080 and keeps its data in named volumes.",
  "pinnedTag": "16-alpine",
  "licenseUrl": "https://github.com/keycloak/keycloak/blob/main/LICENSE.txt",
  "licenseClassLabel": "Permissive license",
  "needsConfig": false,
  "gpu": false,
  "firstRun": [],
  "services": [
    {
      "name": "db",
      "image": "postgres",
      "tag": "16-alpine",
      "ports": [],
      "volumes": [
        "keycloak_postgres_db_data -> /var/lib/postgresql/data"
      ]
    },
    {
      "name": "keycloak",
      "image": "quay.io/keycloak/keycloak",
      "tag": "26.1",
      "ports": [
        8080
      ],
      "volumes": [
        "keycloak_postgres_data -> /opt/keycloak/data"
      ]
    }
  ],
  "env": [
    {
      "service": "db",
      "name": "POSTGRES_DB",
      "kind": "preset"
    },
    {
      "service": "db",
      "name": "POSTGRES_PASSWORD",
      "kind": "generated"
    },
    {
      "service": "db",
      "name": "POSTGRES_USER",
      "kind": "preset"
    },
    {
      "service": "keycloak",
      "name": "KC_BOOTSTRAP_ADMIN_PASSWORD",
      "kind": "generated"
    },
    {
      "service": "keycloak",
      "name": "KC_BOOTSTRAP_ADMIN_USERNAME",
      "kind": "generated"
    },
    {
      "service": "keycloak",
      "name": "KC_DB",
      "kind": "preset"
    },
    {
      "service": "keycloak",
      "name": "KC_DB_PASSWORD",
      "kind": "generated"
    },
    {
      "service": "keycloak",
      "name": "KC_DB_URL",
      "kind": "preset"
    },
    {
      "service": "keycloak",
      "name": "KC_DB_USERNAME",
      "kind": "preset"
    },
    {
      "service": "keycloak",
      "name": "KC_HEALTH_ENABLED",
      "kind": "preset"
    },
    {
      "service": "keycloak",
      "name": "KC_HOSTNAME",
      "kind": "preset"
    },
    {
      "service": "keycloak",
      "name": "KC_HTTP_ENABLED",
      "kind": "preset"
    },
    {
      "service": "keycloak",
      "name": "KC_LEGACY_OBSERVABILITY_INTERFACE",
      "kind": "preset"
    },
    {
      "service": "keycloak",
      "name": "KC_PROXY_HEADERS",
      "kind": "preset"
    }
  ],
  "verifiedTag": null,
  "verifiedArches": [],
  "aliases": [],
  "findings": [],
  "compose": null,
  "deploy": {
    "cli": "levelrail-cli templates deploy keycloak-postgres --name my-keycloak-postgres",
    "api": "curl -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  https://levelrail.example.com/api/v1/service-templates/keycloak-postgres/deploy",
    "stack": null,
    "terraform": null,
    "formats": [
      {
        "id": "cli",
        "label": "CLI",
        "lang": "bash",
        "code": "levelrail-cli templates deploy keycloak-postgres --name my-keycloak-postgres"
      },
      {
        "id": "api",
        "label": "API",
        "lang": "bash",
        "code": "curl -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  https://levelrail.example.com/api/v1/service-templates/keycloak-postgres/deploy",
        "note": "Create a token in the dashboard first. This one-click route deploys it as a trial app you can keep or remove."
      }
    ]
  }
}
