{
  "manifest_version": "1.0.0",
  "template": {
    "id": "0a7f4703-eb28-49c1-b440-64532f38f7ae",
    "slug": "deploy-openclaw-discord-on-railway",
    "name": "OpenClaw Discord",
    "description": "OpenClaw Gateway connected to a Discord bot",
    "url": "https://railway.com/deploy/deploy-openclaw-discord-on-railway",
    "upstream": {
      "image": "openclaw/openclaw:2026.10.3-browser@sha256:c84c4c37e7b9dc02dd869c9699ba0c4fb20ff821febe4b789bb2f8f4bfd9c8a3"
    }
  },
  "services": [
    {
      "name": "OpenClaw",
      "source": {
        "image": "openclaw/openclaw:2026.10.3-browser@sha256:c84c4c37e7b9dc02dd869c9699ba0c4fb20ff821febe4b789bb2f8f4bfd9c8a3"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "TZ",
      "service": "OpenClaw",
      "description": "Timezone for logs and scheduled tasks.",
      "secret": false,
      "strategy": "default",
      "default": "UTC"
    },
    {
      "key": "HOME",
      "service": "OpenClaw",
      "description": "Home directory for the node user, on the volume.",
      "secret": false,
      "strategy": "default",
      "default": "/home/node"
    },
    {
      "key": "PORT",
      "service": "OpenClaw",
      "description": "HTTP port Railway routes to (18789).",
      "secret": false,
      "strategy": "default",
      "default": "18789"
    },
    {
      "key": "OPENCLAW_HOME",
      "service": "OpenClaw",
      "description": "OpenClaw home directory on the volume.",
      "secret": false,
      "strategy": "default",
      "default": "/home/node"
    },
    {
      "key": "RAILWAY_RUN_UID",
      "service": "OpenClaw",
      "description": "User ID Railway runs the container as.",
      "secret": false,
      "strategy": "default",
      "default": "0"
    },
    {
      "key": "OPENCLAW_STATE_DIR",
      "service": "OpenClaw",
      "description": "Gateway state directory on the /data volume.",
      "secret": false,
      "strategy": "default",
      "default": "/data/.openclaw"
    },
    {
      "key": "OPENCLAW_CONFIG_DIR",
      "service": "OpenClaw",
      "description": "Config directory on the /data volume.",
      "secret": false,
      "strategy": "default",
      "default": "/data/.openclaw"
    },
    {
      "key": "OPENCLAW_CONFIG_PATH",
      "service": "OpenClaw",
      "description": "Path to the OpenClaw config file.",
      "secret": false,
      "strategy": "default",
      "default": "/data/.openclaw/openclaw.json"
    },
    {
      "key": "OPENCLAW_GATEWAY_BIND",
      "service": "OpenClaw",
      "description": "Gateway bind mode; lan so Railway can reach it.",
      "secret": false,
      "strategy": "default",
      "default": "lan"
    },
    {
      "key": "OPENCLAW_GATEWAY_PORT",
      "service": "OpenClaw",
      "description": "Gateway listen port; keep equal to PORT.",
      "secret": false,
      "strategy": "default",
      "default": "18789"
    },
    {
      "key": "OPENCLAW_GATEWAY_TOKEN",
      "service": "OpenClaw",
      "description": "Gateway auth token for the Control UI, generated per deploy.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "OPENCLAW_WORKSPACE_DIR",
      "service": "OpenClaw",
      "description": "Agent workspace directory on the /data volume.",
      "secret": false,
      "strategy": "default",
      "default": "/data/workspace"
    },
    {
      "key": "OPENCLAW_RAILWAY_CONFIG",
      "service": "OpenClaw",
      "description": "Start-time config: public origin, allowed origins, proxies.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "deploy-openclaw-discord-on-railway"
      }
    },
    "cli": "railway deploy --template deploy-openclaw-discord-on-railway",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "0a7f4703-eb28-49c1-b440-64532f38f7ae",
            "serializedConfig": {
              "services": {
                "b50a3e94-eb00-4bd6-8bae-5e8a1c8d48b7": {
                  "icon": null,
                  "name": "OpenClaw",
                  "deploy": {
                    "startCommand": "/bin/sh -c \"set -ef; D=${RAILWAY_VOLUME_MOUNT_PATH:-/data}; mkdir -p $D/.openclaw $D/workspace $D/.config/openclaw; if [ ! -L /home/node/.config/openclaw ]; then rm -rf /home/node/.config/openclaw; ln -s $D/.config/openclaw /home/node/.config/openclaw; fi; find $D ! -user 1000 -exec chown -h 1000:1000 {} +; chmod 700 $D/.openclaw; cd /app; if [ ${#OPENCLAW_RAILWAY_CONFIG} -gt 0 ]; then setpriv --reuid=1000 --regid=1000 --init-groups env HOME=/home/node USER=node node openclaw.mjs config set --batch-json $OPENCLAW_RAILWAY_CONFIG || echo railway-start: config batch failed; fi; exec setpriv --reuid=1000 --regid=1000 --init-groups env HOME=/home/node USER=node tini -s -- node /app/docker-entrypoint.mjs node openclaw.mjs gateway --bind lan --port 18789 --allow-unconfigured\"",
                    "healthcheckPath": "/healthz",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "openclaw/openclaw:2026.10.3-browser@sha256:c84c4c37e7b9dc02dd869c9699ba0c4fb20ff821febe4b789bb2f8f4bfd9c8a3"
                  },
                  "variables": {
                    "TZ": {
                      "isOptional": false,
                      "description": "Timezone for logs and scheduled tasks.",
                      "defaultValue": "UTC"
                    },
                    "HOME": {
                      "isOptional": false,
                      "description": "Home directory for the node user, on the volume.",
                      "defaultValue": "/home/node"
                    },
                    "PORT": {
                      "isOptional": false,
                      "description": "HTTP port Railway routes to (18789).",
                      "defaultValue": "18789"
                    },
                    "OPENCLAW_HOME": {
                      "isOptional": false,
                      "description": "OpenClaw home directory on the volume.",
                      "defaultValue": "/home/node"
                    },
                    "OPENAI_API_KEY": {
                      "isOptional": true,
                      "description": "Optional OpenAI key for models.",
                      "defaultValue": ""
                    },
                    "RAILWAY_RUN_UID": {
                      "isOptional": false,
                      "description": "User ID Railway runs the container as.",
                      "defaultValue": "0"
                    },
                    "ANTHROPIC_API_KEY": {
                      "isOptional": true,
                      "description": "Optional Anthropic key for Claude models.",
                      "defaultValue": ""
                    },
                    "OPENCLAW_STATE_DIR": {
                      "isOptional": false,
                      "description": "Gateway state directory on the /data volume.",
                      "defaultValue": "/data/.openclaw"
                    },
                    "TELEGRAM_BOT_TOKEN": {
                      "isOptional": true,
                      "description": "Optional Telegram bot token from BotFather.",
                      "defaultValue": ""
                    },
                    "OPENCLAW_CONFIG_DIR": {
                      "isOptional": false,
                      "description": "Config directory on the /data volume.",
                      "defaultValue": "/data/.openclaw"
                    },
                    "OPENCLAW_CONFIG_PATH": {
                      "isOptional": false,
                      "description": "Path to the OpenClaw config file.",
                      "defaultValue": "/data/.openclaw/openclaw.json"
                    },
                    "OPENCLAW_GATEWAY_BIND": {
                      "isOptional": false,
                      "description": "Gateway bind mode; lan so Railway can reach it.",
                      "defaultValue": "lan"
                    },
                    "OPENCLAW_GATEWAY_PORT": {
                      "isOptional": false,
                      "description": "Gateway listen port; keep equal to PORT.",
                      "defaultValue": "18789"
                    },
                    "OPENCLAW_GATEWAY_TOKEN": {
                      "isOptional": false,
                      "description": "Gateway auth token for the Control UI, generated per deploy.",
                      "defaultValue": "{{OPENCLAW_GATEWAY_TOKEN}}"
                    },
                    "OPENCLAW_WORKSPACE_DIR": {
                      "isOptional": false,
                      "description": "Agent workspace directory on the /data volume.",
                      "defaultValue": "/data/workspace"
                    },
                    "OPENCLAW_RAILWAY_CONFIG": {
                      "isOptional": false,
                      "description": "Start-time config: public origin, allowed origins, proxies.",
                      "defaultValue": "[{\"path\":\"gateway.mode\",\"value\":\"local\"},{\"path\":\"gateway.publicOrigin\",\"value\":\"https://${{RAILWAY_PUBLIC_DOMAIN}}\"},{\"path\":\"gateway.controlUi.allowedOrigins\",\"value\":[\"https://${{RAILWAY_PUBLIC_DOMAIN}}\"]},{\"path\":\"gateway.trustedProxies\",\"value\":[\"100.64.0.0/10\"]}]"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:18789": {
                        "port": 18789
                      }
                    }
                  },
                  "volumeMounts": {
                    "b50a3e94-eb00-4bd6-8bae-5e8a1c8d48b7": {
                      "mountPath": "/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "OpenClaw",
      "method": "GET",
      "path": "/healthz",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 1,
    "needs_volume": true
  },
  "generated_at": "2026-10-17T04:14:47.046Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-10-17T02:25:25.842Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_873c74ce55f8490589aa",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 133,
    "typical_build_seconds": 0,
    "typical_start_seconds": 73,
    "slowest_service": "OpenClaw"
  }
}
