{
  "manifest_version": "1.0.0",
  "template": {
    "id": "53b03918-d2d0-47b2-b0c9-4e322dd4a56f",
    "slug": "logto-auth",
    "name": "Logto",
    "description": "Open-source identity provider with hosted sign-in, SSO, RBAC and MFA",
    "url": "https://railway.com/deploy/logto-auth",
    "upstream": {
      "image": "svhd/logto:latest"
    }
  },
  "services": [
    {
      "name": "Postgres",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    },
    {
      "name": "Logto",
      "source": {
        "image": "svhd/logto:latest"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "Redis",
      "source": {
        "image": "redis:8.2"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "http": false
    },
    {
      "name": "Logto Admin Console",
      "source": {
        "image": "svhd/logto:latest"
      },
      "needs_volume": false,
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Cluster location on the volume",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "Postgres",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "Postgres",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "Postgres",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "Postgres",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "Postgres",
      "description": "Data panel alias, not read by the server",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Database created on first boot",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "DATABASE_URL",
      "service": "Postgres",
      "description": "Private connection string",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Superuser created on first boot",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "SSL_CERT_DAYS",
      "service": "Postgres",
      "description": "SSL certificate expiry in days",
      "secret": false,
      "strategy": "default",
      "default": "820"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Superuser password",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Postgres",
      "description": "Clean shutdown window",
      "secret": false,
      "strategy": "default",
      "default": "60"
    },
    {
      "key": "PORT",
      "service": "Logto",
      "description": "Auth endpoint listening port",
      "secret": false,
      "strategy": "default",
      "default": "3001"
    },
    {
      "key": "DB_URL",
      "service": "Logto",
      "description": "Postgres connection string",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "ENDPOINT",
      "service": "Logto",
      "description": "Public auth URL and OIDC issuer",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "REDIS_URL",
      "service": "Logto",
      "description": "Shared configuration cache",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "NODE_OPTIONS",
      "service": "Logto",
      "description": "Node heap ceiling for the container",
      "secret": false,
      "strategy": "default",
      "default": "--max-old-space-size=2048"
    },
    {
      "key": "ADMIN_ENDPOINT",
      "service": "Logto",
      "description": "Console URL, allowed CORS origin",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "SECRET_VAULT_KEK",
      "service": "Logto",
      "description": "Base64 32-byte secret vault key",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "DATABASE_POOL_SIZE",
      "service": "Logto",
      "description": "Postgres connections per tenant",
      "secret": false,
      "strategy": "default",
      "default": "10"
    },
    {
      "key": "TRUST_PROXY_HEADER",
      "service": "Logto",
      "description": "Honour X-Forwarded-* from the edge",
      "secret": false,
      "strategy": "default",
      "default": "1"
    },
    {
      "key": "ADMIN_DISABLE_LOCALHOST",
      "service": "Logto",
      "description": "Never open the console port here",
      "secret": false,
      "strategy": "default",
      "default": "1"
    },
    {
      "key": "REDISHOST",
      "service": "Redis",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "REDISPORT",
      "service": "Redis",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "default",
      "default": "6379"
    },
    {
      "key": "REDISUSER",
      "service": "Redis",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "default",
      "default": "default"
    },
    {
      "key": "REDIS_URL",
      "service": "Redis",
      "description": "Private connection string",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "REDISPASSWORD",
      "service": "Redis",
      "description": "Data panel alias, not read by the server",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "REDIS_PASSWORD",
      "service": "Redis",
      "description": "Auth password, read by the server",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "PORT",
      "service": "Logto Admin Console",
      "description": "Auth listener, used by the health check",
      "secret": false,
      "strategy": "default",
      "default": "3001"
    },
    {
      "key": "DB_URL",
      "service": "Logto Admin Console",
      "description": "Postgres connection string",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "ENDPOINT",
      "service": "Logto Admin Console",
      "description": "Public auth URL and OIDC issuer",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "REDIS_URL",
      "service": "Logto Admin Console",
      "description": "Shared configuration cache",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "ADMIN_PORT",
      "service": "Logto Admin Console",
      "description": "Console listener, served publicly",
      "secret": false,
      "strategy": "default",
      "default": "3002"
    },
    {
      "key": "NODE_OPTIONS",
      "service": "Logto Admin Console",
      "description": "Node heap ceiling for the container",
      "secret": false,
      "strategy": "default",
      "default": "--max-old-space-size=2048"
    },
    {
      "key": "ADMIN_ENDPOINT",
      "service": "Logto Admin Console",
      "description": "Public admin console URL",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "LOGTO_CORE_HOST",
      "service": "Logto Admin Console",
      "description": "Waited on before startup",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "SECRET_VAULT_KEK",
      "service": "Logto Admin Console",
      "description": "Must match the auth service",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "DATABASE_POOL_SIZE",
      "service": "Logto Admin Console",
      "description": "Postgres connections per tenant",
      "secret": false,
      "strategy": "default",
      "default": "10"
    },
    {
      "key": "TRUST_PROXY_HEADER",
      "service": "Logto Admin Console",
      "description": "Honour X-Forwarded-* from the edge",
      "secret": false,
      "strategy": "default",
      "default": "1"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "logto-auth"
      }
    },
    "cli": "railway deploy --template logto-auth",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "53b03918-d2d0-47b2-b0c9-4e322dd4a56f",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "6aad5343-4a27-4c94-82ce-6a7bb95684cd": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/postgresql.svg",
                  "name": "Postgres",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Cluster location on the volume",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Database created on first boot",
                      "defaultValue": "railway"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Private connection string",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Superuser created on first boot",
                      "defaultValue": "postgres"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": false,
                      "description": "SSL certificate expiry in days",
                      "defaultValue": "820"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Superuser password",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Clean shutdown window",
                      "defaultValue": "60"
                    }
                  },
                  "volumeMounts": {
                    "6aad5343-4a27-4c94-82ce-6a7bb95684cd": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                },
                "6b6fa248-0502-465c-8238-16d37507ebe4": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/logto.svg",
                  "name": "Logto",
                  "deploy": {
                    "startCommand": "/bin/sh -c 'for i in $(seq 1 30); do npm run cli db seed -- --swe && break; echo \"logto: seed attempt $i failed, retrying\"; sleep 5; done; npm run alteration deploy latest; exec npm run start'",
                    "healthcheckPath": "/api/status",
                    "restartPolicyType": "ALWAYS",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "svhd/logto:latest"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Auth endpoint listening port",
                      "defaultValue": "3001"
                    },
                    "DB_URL": {
                      "isOptional": false,
                      "description": "Postgres connection string",
                      "defaultValue": "${{Postgres.DATABASE_URL}}"
                    },
                    "ENDPOINT": {
                      "isOptional": false,
                      "description": "Public auth URL and OIDC issuer",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "REDIS_URL": {
                      "isOptional": false,
                      "description": "Shared configuration cache",
                      "defaultValue": "${{Redis.REDIS_URL}}"
                    },
                    "NODE_OPTIONS": {
                      "isOptional": false,
                      "description": "Node heap ceiling for the container",
                      "defaultValue": "--max-old-space-size=2048"
                    },
                    "ADMIN_ENDPOINT": {
                      "isOptional": false,
                      "description": "Console URL, allowed CORS origin",
                      "defaultValue": "https://${{\"Logto Admin Console\".RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "SECRET_VAULT_KEK": {
                      "isOptional": false,
                      "description": "Base64 32-byte secret vault key",
                      "defaultValue": "{{SECRET_VAULT_KEK}}"
                    },
                    "DATABASE_POOL_SIZE": {
                      "isOptional": false,
                      "description": "Postgres connections per tenant",
                      "defaultValue": "10"
                    },
                    "TRUST_PROXY_HEADER": {
                      "isOptional": false,
                      "description": "Honour X-Forwarded-* from the edge",
                      "defaultValue": "1"
                    },
                    "ADMIN_DISABLE_LOCALHOST": {
                      "isOptional": false,
                      "description": "Never open the console port here",
                      "defaultValue": "1"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:3001": {
                        "port": 3001
                      }
                    }
                  }
                },
                "ca8f0f92-8e0b-4e61-8490-4ef4d868cd9d": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/redis.svg",
                  "name": "Redis",
                  "deploy": {
                    "startCommand": "/bin/sh -c \"rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH\"",
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "redis:8.2"
                  },
                  "variables": {
                    "REDISHOST": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "REDISPORT": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "6379"
                    },
                    "REDISUSER": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "default"
                    },
                    "REDIS_URL": {
                      "isOptional": false,
                      "description": "Private connection string",
                      "defaultValue": "redis://${{REDISUSER}}:${{REDIS_PASSWORD}}@${{REDISHOST}}:${{REDISPORT}}"
                    },
                    "REDISPASSWORD": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{REDIS_PASSWORD}}"
                    },
                    "REDIS_PASSWORD": {
                      "isOptional": false,
                      "description": "Auth password, read by the server",
                      "defaultValue": "{{REDIS_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "ca8f0f92-8e0b-4e61-8490-4ef4d868cd9d": {
                      "mountPath": "/data"
                    }
                  }
                },
                "e35ecc29-e845-4151-98a0-6a7b95740329": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/logto.svg",
                  "name": "Logto Admin Console",
                  "deploy": {
                    "startCommand": "/bin/sh -c 'H=\"$LOGTO_CORE_HOST\"; case \"$H\" in \"\"|:*) H=logto.railway.internal:3001;; esac; for i in $(seq 1 60); do node -e \"fetch(process.argv[1]).then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))\" \"http://$H/api/status\" && break; echo \"logto-admin: waiting for core at $H ($i)\"; sleep 5; done; npm run alteration deploy latest; exec npm run start'",
                    "healthcheckPath": "/api/status",
                    "restartPolicyType": "ALWAYS",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "svhd/logto:latest"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Auth listener, used by the health check",
                      "defaultValue": "3001"
                    },
                    "DB_URL": {
                      "isOptional": false,
                      "description": "Postgres connection string",
                      "defaultValue": "${{Postgres.DATABASE_URL}}"
                    },
                    "ENDPOINT": {
                      "isOptional": false,
                      "description": "Public auth URL and OIDC issuer",
                      "defaultValue": "${{Logto.ENDPOINT}}"
                    },
                    "REDIS_URL": {
                      "isOptional": false,
                      "description": "Shared configuration cache",
                      "defaultValue": "${{Redis.REDIS_URL}}"
                    },
                    "ADMIN_PORT": {
                      "isOptional": false,
                      "description": "Console listener, served publicly",
                      "defaultValue": "3002"
                    },
                    "NODE_OPTIONS": {
                      "isOptional": false,
                      "description": "Node heap ceiling for the container",
                      "defaultValue": "--max-old-space-size=2048"
                    },
                    "ADMIN_ENDPOINT": {
                      "isOptional": false,
                      "description": "Public admin console URL",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "LOGTO_CORE_HOST": {
                      "isOptional": false,
                      "description": "Waited on before startup",
                      "defaultValue": "${{Logto.RAILWAY_PRIVATE_DOMAIN}}:3001"
                    },
                    "SECRET_VAULT_KEK": {
                      "isOptional": false,
                      "description": "Must match the auth service",
                      "defaultValue": "${{Logto.SECRET_VAULT_KEK}}"
                    },
                    "DATABASE_POOL_SIZE": {
                      "isOptional": false,
                      "description": "Postgres connections per tenant",
                      "defaultValue": "10"
                    },
                    "TRUST_PROXY_HEADER": {
                      "isOptional": false,
                      "description": "Honour X-Forwarded-* from the edge",
                      "defaultValue": "1"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:3002": {
                        "port": 3002
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "Logto",
      "method": "GET",
      "path": "/api/status",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 4,
    "needs_volume": true
  },
  "generated_at": "2026-09-20T22:14:37.505Z",
  "generator_version": "0.1.0",
  "status": "degraded",
  "validated_at": "2026-09-19T14:40:39.004Z",
  "success_rate_30d": 0,
  "validation": {
    "last_run_id": "run_c94365e20ab14775bf27",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": false,
        "detail": "got 204, expected 200"
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ]
  }
}
