{
  "manifest_version": "1.0.0",
  "template": {
    "id": "00db0878-3496-4653-9918-df681d524ea8",
    "slug": "mSwigX",
    "name": "Keycloak",
    "description": "Keycloak template with keywind theme + apple and discord providers",
    "url": "https://railway.com/deploy/mSwigX",
    "upstream": {
      "repo_url": "https://github.com/leonardochappuis/keycloak-docker"
    }
  },
  "services": [
    {
      "name": "Keycloak",
      "source": {
        "repo": "https://github.com/leonardochappuis/keycloak-docker"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "Postgres",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:latest"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "Keycloak",
      "description": "Default port",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    },
    {
      "key": "KC_DB",
      "service": "Keycloak",
      "description": "Type of database used by Keycloak",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "KC_PROXY",
      "service": "Keycloak",
      "description": "Proxy address forwarding mode",
      "secret": false,
      "strategy": "default",
      "default": "edge"
    },
    {
      "key": "KC_DB_URL",
      "service": "Keycloak",
      "description": "Connection url to the db using jdbc",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "KC_FEATURES",
      "service": "Keycloak",
      "description": "Enables Technology Preview and/or deprecated features",
      "secret": false,
      "strategy": "default",
      "default": "token-exchange"
    },
    {
      "key": "KC_HOSTNAME",
      "service": "Keycloak",
      "description": "URL to reach keycloak, defaults to railway public generated url",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "KC_HTTP_PORT",
      "service": "Keycloak",
      "description": "Port which http listener will listen",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    },
    {
      "key": "KC_DB_PASSWORD",
      "service": "Keycloak",
      "description": "DB Password",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "KC_DB_USERNAME",
      "service": "Keycloak",
      "description": "DB username",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "KEYCLOAK_ADMIN",
      "service": "Keycloak",
      "description": "Your default admin username",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "KC_HTTP_ENABLED",
      "service": "Keycloak",
      "description": "Enables http listener",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "KC_HEALTH_ENABLED",
      "service": "Keycloak",
      "description": "Enables Keycloak Health checks",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "KC_HOSTNAME_STRICT",
      "service": "Keycloak",
      "description": "Disables dynamically resolving the hostname from request headers.",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "KC_METRICS_ENABLED",
      "service": "Keycloak",
      "description": "If enabled, metrics will be available at the /metrics endpoint.",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "KC_DB_POOL_MIN_SIZE",
      "service": "Keycloak",
      "description": "Minimum pool size for db",
      "secret": false,
      "strategy": "default",
      "default": "0"
    },
    {
      "key": "KEYCLOAK_ADMIN_PASSWORD",
      "service": "Keycloak",
      "description": "Default admin password",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "PROXY_ADDRESS_FORWARDING",
      "service": "Keycloak",
      "description": "Enables proxy address forwarding",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "KC_HOSTNAME_STRICT_BACKCHANNEL",
      "service": "Keycloak",
      "description": "By default backchannel URLs are dynamically resolved from request headers to allow internal and external applications.",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "QUARKUS_TRANSACTION_MANAGER_ENABLE_RECOVERY",
      "service": "Keycloak",
      "description": "Enables transaction recovery",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Mount point",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "default db name",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "POSTGRES_HOST",
      "service": "Postgres",
      "description": "Proxy domain if you need access from outside of the private network.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_PORT",
      "service": "Postgres",
      "description": "If you need access from outside of the private network.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "db user",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "SSL_CERT_DAYS",
      "service": "Postgres",
      "description": "days ssl cert should last",
      "secret": false,
      "strategy": "default",
      "default": "820"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "db password",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "POSTGRES_PRIVATE_HOST",
      "service": "Postgres",
      "description": "Private domain",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_PRIVATE_PORT",
      "service": "Postgres",
      "description": "Private port",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "mSwigX"
      }
    },
    "cli": "railway deploy --template mSwigX",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "00db0878-3496-4653-9918-df681d524ea8",
            "serializedConfig": {
              "services": {
                "1bce8dff-e6cb-4ccc-866b-1cbd666bb68f": {
                  "icon": "https://www.keycloak.org/resources/images/logo.svg",
                  "name": "Keycloak",
                  "build": {},
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/resources/master/admin/en"
                  },
                  "source": {
                    "repo": "https://github.com/leonardochappuis/keycloak-docker",
                    "rootDirectory": null
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Default port",
                      "defaultValue": "8080"
                    },
                    "KC_DB": {
                      "isOptional": false,
                      "description": "Type of database used by Keycloak",
                      "defaultValue": "postgres"
                    },
                    "KC_PROXY": {
                      "isOptional": false,
                      "description": "Proxy address forwarding mode",
                      "defaultValue": "edge"
                    },
                    "KC_DB_URL": {
                      "isOptional": false,
                      "description": "Connection url to the db using jdbc",
                      "defaultValue": "jdbc:postgresql://${{Postgres.POSTGRES_PRIVATE_HOST}}:${{Postgres.POSTGRES_PRIVATE_PORT}}/${{Postgres.POSTGRES_DATABASE}}"
                    },
                    "KC_FEATURES": {
                      "isOptional": false,
                      "description": "Enables Technology Preview and/or deprecated features",
                      "defaultValue": "token-exchange"
                    },
                    "KC_HOSTNAME": {
                      "isOptional": false,
                      "description": "URL to reach keycloak, defaults to railway public generated url",
                      "defaultValue": "${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "KC_HTTP_PORT": {
                      "isOptional": false,
                      "description": "Port which http listener will listen",
                      "defaultValue": "8080"
                    },
                    "KC_DB_PASSWORD": {
                      "isOptional": false,
                      "description": "DB Password",
                      "defaultValue": "${{Postgres.POSTGRES_PASSWORD}}"
                    },
                    "KC_DB_USERNAME": {
                      "isOptional": false,
                      "description": "DB username",
                      "defaultValue": "${{Postgres.POSTGRES_USER}}"
                    },
                    "KEYCLOAK_ADMIN": {
                      "isOptional": false,
                      "description": "Your default admin username",
                      "defaultValue": "{{KEYCLOAK_ADMIN}}"
                    },
                    "KC_HTTP_ENABLED": {
                      "isOptional": false,
                      "description": "Enables http listener",
                      "defaultValue": "true"
                    },
                    "KC_HEALTH_ENABLED": {
                      "isOptional": false,
                      "description": "Enables Keycloak Health checks",
                      "defaultValue": "true"
                    },
                    "KC_HOSTNAME_STRICT": {
                      "isOptional": false,
                      "description": "Disables dynamically resolving the hostname from request headers.",
                      "defaultValue": "true"
                    },
                    "KC_METRICS_ENABLED": {
                      "isOptional": false,
                      "description": "If enabled, metrics will be available at the /metrics endpoint.",
                      "defaultValue": "true"
                    },
                    "KC_DB_POOL_MIN_SIZE": {
                      "isOptional": false,
                      "description": "Minimum pool size for db",
                      "defaultValue": "0"
                    },
                    "KEYCLOAK_ADMIN_PASSWORD": {
                      "isOptional": false,
                      "description": "Default admin password",
                      "defaultValue": "{{KEYCLOAK_ADMIN_PASSWORD}}"
                    },
                    "PROXY_ADDRESS_FORWARDING": {
                      "isOptional": false,
                      "description": "Enables proxy address forwarding",
                      "defaultValue": "true"
                    },
                    "KC_HOSTNAME_STRICT_BACKCHANNEL": {
                      "isOptional": false,
                      "description": "By default backchannel URLs are dynamically resolved from request headers to allow internal and external applications.",
                      "defaultValue": "true"
                    },
                    "QUARKUS_TRANSACTION_MANAGER_ENABLE_RECOVERY": {
                      "isOptional": false,
                      "description": "Enables transaction recovery",
                      "defaultValue": "true"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  },
                  "volumeMounts": {}
                },
                "d3c27d6c-a30b-4549-a00a-1c279feb32c4": {
                  "icon": "https://images.icon-icons.com/2415/PNG/512/postgresql_plain_wordmark_logo_icon_146390.png",
                  "name": "Postgres",
                  "build": {},
                  "deploy": {},
                  "source": {
                    "image": "ghcr.io/railwayapp-templates/postgres-ssl:latest",
                    "rootDirectory": ""
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Mount point",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "default db name",
                      "defaultValue": "railway"
                    },
                    "POSTGRES_HOST": {
                      "isOptional": true,
                      "description": "Proxy domain if you need access from outside of the private network.",
                      "defaultValue": "${{RAILWAY_TCP_PROXY_DOMAIN}}"
                    },
                    "POSTGRES_PORT": {
                      "isOptional": true,
                      "description": "If you need access from outside of the private network.",
                      "defaultValue": "${{RAILWAY_TCP_PROXY_PORT}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "db user",
                      "defaultValue": "postgres"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": false,
                      "description": "days ssl cert should last",
                      "defaultValue": "820"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "db password",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_PRIVATE_HOST": {
                      "isOptional": false,
                      "description": "Private domain",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "POSTGRES_PRIVATE_PORT": {
                      "isOptional": false,
                      "description": "Private port",
                      "defaultValue": "5432"
                    }
                  },
                  "networking": {
                    "tcpProxies": {},
                    "serviceDomains": {}
                  },
                  "volumeMounts": {
                    "d3c27d6c-a30b-4549-a00a-1c279feb32c4": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  },
                  "haTemplateCode": "postgres-ha",
                  "haConversionConfig": {
                    "edge": {
                      "label": "Reverse Proxy",
                      "options": [
                        2,
                        3,
                        4,
                        5
                      ],
                      "nodeLabel": "HAProxy",
                      "description": "Routes traffic to the primary",
                      "defaultValue": 3
                    },
                    "replica": {
                      "label": "Replicas",
                      "options": [
                        2,
                        3,
                        4,
                        5,
                        6,
                        7
                      ],
                      "nodeLabel": "Postgres",
                      "description": "Streaming replicas for automatic failover",
                      "defaultValue": 2
                    },
                    "internal": {
                      "label": "Coordinator Nodes",
                      "options": [
                        3,
                        5,
                        7,
                        9
                      ],
                      "nodeLabel": "etcd",
                      "defaultValue": 3
                    },
                    "description": "This will convert your Postgres database to an HA cluster with Patroni failover and etcd consensus."
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "Keycloak",
      "method": "GET",
      "path": "/resources/master/admin/en",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-22T04:14:41.730Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-21T16:25:17.183Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_d2d67d61348945fc9d17",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 134,
    "typical_build_seconds": 42,
    "typical_start_seconds": 20,
    "slowest_service": "Keycloak"
  }
}
