{
  "manifest_version": "1.0.0",
  "template": {
    "id": "e6a209b6-ef4e-465a-be04-d305a103a749",
    "slug": "convex-self-hosted",
    "name": "Convex [Updated Sep '26]",
    "description": "Convex self-hosted — Backend + Dashboard + Postgres, verified live",
    "url": "https://railway.com/deploy/convex-self-hosted",
    "upstream": {
      "image": "ghcr.io/get-convex/convex-dashboard:latest"
    }
  },
  "services": [
    {
      "name": "Convex Dashboard",
      "source": {
        "image": "ghcr.io/get-convex/convex-dashboard:latest"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "Convex Backend",
      "source": {
        "image": "ghcr.io/get-convex/convex-backend:latest"
      },
      "needs_volume": true,
      "volume_mount_path": "/convex/data",
      "tcp_ports": [
        3211
      ],
      "http": true
    },
    {
      "name": "Postgres",
      "source": {
        "image": "postgres:17"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "Convex Dashboard",
      "description": "Port the dashboard's Next.js server listens on.",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    },
    {
      "key": "NEXT_PUBLIC_DEPLOYMENT_URL",
      "service": "Convex Dashboard",
      "description": "Points the dashboard at your backend's Cloud API. References the Backend service directly — stays correct automatically if that origin ever changes.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PORT",
      "service": "Convex Backend",
      "description": "The Cloud API's port. Do not change — the start command and networking config both assume this value.",
      "secret": false,
      "strategy": "default",
      "default": "3210"
    },
    {
      "key": "RUST_LOG",
      "service": "Convex Backend",
      "description": "Log verbosity for the backend (Rust-based). debug gives more detail if you're troubleshooting.",
      "secret": false,
      "strategy": "default",
      "default": "info"
    },
    {
      "key": "POSTGRES_URL",
      "service": "Convex Backend",
      "description": "Connection string to the Postgres service, sourced automatically from its own variables.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "INSTANCE_NAME",
      "service": "Convex Backend",
      "description": "Identifies this Convex instance. References the Postgres service's own database name.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "DISABLE_BEACON",
      "service": "Convex Backend",
      "description": "Disables Convex's telemetry beacon.",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "INSTANCE_SECRET",
      "service": "Convex Backend",
      "description": "Per-deployment secret used (with INSTANCE_NAME) to deterministically derive the admin key. Auto-generated — never needs manual editing.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "CONVEX_SITE_ORIGIN",
      "service": "Convex Backend",
      "description": "The origin for HTTP Actions (Convex functions exposed over plain HTTP). Public by default; switch to the private variant for internal-only use.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "DO_NOT_REQUIRE_SSL",
      "service": "Convex Backend",
      "description": "Allows the backend to accept connections without enforcing TLS itself — Railway's own edge already terminates TLS for the public domain.",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "CONVEX_CLOUD_ORIGIN",
      "service": "Convex Backend",
      "description": "The origin your frontend/CLI actually connects to for the main API. Points at the public origin by default — switch to ${{PRIVATE_CONVEX_CLOUD_ORIGIN}} for a private-only deployment.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "CONVEX_SELF_HOSTED_URL",
      "service": "Convex Backend",
      "description": "Mirrors CONVEX_CLOUD_ORIGIN — some tooling reads this name instead.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PUBLIC_CONVEX_SITE_ORIGIN",
      "service": "Convex Backend",
      "description": "Publicly reachable HTTP Actions origin, routed through Railway's TCP proxy on port 3211.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PRIVATE_CONVEX_SITE_ORIGIN",
      "service": "Convex Backend",
      "description": "Internal-only HTTP Actions origin.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PUBLIC_CONVEX_CLOUD_ORIGIN",
      "service": "Convex Backend",
      "description": "Publicly reachable Cloud API origin — what your deployed frontend actually talks to by default.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "PRIVATE_CONVEX_CLOUD_ORIGIN",
      "service": "Convex Backend",
      "description": "Internal-only Cloud API origin, reachable only from other services in this Railway project.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "CONVEX_SELF_HOSTED_ADMIN_KEY",
      "service": "Convex Backend",
      "description": "Starts as invalid so the backend generates a real key on first boot and prints it to the deploy logs. Paste the generated value back here once you have it — see README.",
      "secret": true,
      "strategy": "default",
      "default": "invalid"
    },
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Where Postgres stores its data files inside the volume.",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "Postgres",
      "description": "Private network hostname for this Postgres instance.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "Postgres",
      "description": "Standard Postgres port.",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "Postgres",
      "description": "Username, mirrored for PG*-convention tools.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGSSLMODE",
      "service": "Postgres",
      "description": "Disables SSL for connections — safe here since traffic stays on Railway's private network, never the public internet.",
      "secret": false,
      "strategy": "default",
      "default": "disable"
    },
    {
      "key": "PGDATABASE",
      "service": "Postgres",
      "description": "Default database name — also used as INSTANCE_NAME on the Backend service.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "Postgres",
      "description": "Password, mirrored for tools that read the PG* convention instead of POSTGRES_*.",
      "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": "Standard full connection string, private network.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Default Postgres superuser.",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "SSL_CERT_DAYS",
      "service": "Postgres",
      "description": "Validity period for the self-signed cert Postgres generates internally.",
      "secret": false,
      "strategy": "default",
      "default": "820"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Auto-generated password for the default Postgres user.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "CONVEX_DATABASE_URL",
      "service": "Postgres",
      "description": "The exact connection string the Convex Backend service reads via its own POSTGRES_URL variable.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Postgres",
      "description": "Grace period Railway gives this service to shut down cleanly before force-killing it — avoids cutting off in-flight queries during a redeploy.",
      "secret": false,
      "strategy": "default",
      "default": "60"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "convex-self-hosted"
      }
    },
    "cli": "railway deploy --template convex-self-hosted",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "e6a209b6-ef4e-465a-be04-d305a103a749",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "0203e80a-5aa2-48aa-8c91-259f87634b08": {
                  "icon": "https://dashboard.convex.dev/convex-logo-only.svg",
                  "name": "Convex Dashboard",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/get-convex/convex-dashboard:latest"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Port the dashboard's Next.js server listens on.",
                      "defaultValue": "8080"
                    },
                    "NEXT_PUBLIC_DEPLOYMENT_URL": {
                      "isOptional": false,
                      "description": "Points the dashboard at your backend's Cloud API. References the Backend service directly — stays correct automatically if that origin ever changes.",
                      "defaultValue": "${{Convex Backend.CONVEX_CLOUD_ORIGIN}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  }
                },
                "0cb836dd-c596-4ee4-8cd5-b8cbfbe64135": {
                  "icon": "https://dashboard.convex.dev/convex-logo-only.svg",
                  "name": "Convex Backend",
                  "deploy": {
                    "startCommand": "sh -c 'mkdir -p \"/convex/data/credentials\" && echo \"$INSTANCE_SECRET\" > \"/convex/data/credentials/instance_secret\" && echo \"$INSTANCE_NAME\" > \"/convex/data/credentials/instance_name\" && ([ -z \"$CONVEX_SELF_HOSTED_ADMIN_KEY\" ] || [ \"$CONVEX_SELF_HOSTED_ADMIN_KEY\" = \"invalid\" ]) && ./generate_admin_key.sh || echo \"Admin key: $CONVEX_SELF_HOSTED_ADMIN_KEY\" && exec ./run_backend.sh'",
                    "healthcheckPath": "/version",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/get-convex/convex-backend:latest"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "The Cloud API's port. Do not change — the start command and networking config both assume this value.",
                      "defaultValue": "3210"
                    },
                    "RUST_LOG": {
                      "isOptional": false,
                      "description": "Log verbosity for the backend (Rust-based). debug gives more detail if you're troubleshooting.",
                      "defaultValue": "info"
                    },
                    "POSTGRES_URL": {
                      "isOptional": false,
                      "description": "Connection string to the Postgres service, sourced automatically from its own variables.",
                      "defaultValue": "${{Postgres.CONVEX_DATABASE_URL}}"
                    },
                    "INSTANCE_NAME": {
                      "isOptional": false,
                      "description": "Identifies this Convex instance. References the Postgres service's own database name.",
                      "defaultValue": "${{Postgres.PGDATABASE}}"
                    },
                    "DISABLE_BEACON": {
                      "isOptional": false,
                      "description": "Disables Convex's telemetry beacon.",
                      "defaultValue": "true"
                    },
                    "INSTANCE_SECRET": {
                      "isOptional": false,
                      "description": "Per-deployment secret used (with INSTANCE_NAME) to deterministically derive the admin key. Auto-generated — never needs manual editing.",
                      "defaultValue": "{{INSTANCE_SECRET}}"
                    },
                    "CONVEX_SITE_ORIGIN": {
                      "isOptional": false,
                      "description": "The origin for HTTP Actions (Convex functions exposed over plain HTTP). Public by default; switch to the private variant for internal-only use.",
                      "defaultValue": "${{PUBLIC_CONVEX_SITE_ORIGIN}}"
                    },
                    "DO_NOT_REQUIRE_SSL": {
                      "isOptional": false,
                      "description": "Allows the backend to accept connections without enforcing TLS itself — Railway's own edge already terminates TLS for the public domain.",
                      "defaultValue": "true"
                    },
                    "CONVEX_CLOUD_ORIGIN": {
                      "isOptional": false,
                      "description": "The origin your frontend/CLI actually connects to for the main API. Points at the public origin by default — switch to ${{PRIVATE_CONVEX_CLOUD_ORIGIN}} for a private-only deployment.",
                      "defaultValue": "${{PUBLIC_CONVEX_CLOUD_ORIGIN}}"
                    },
                    "CONVEX_SELF_HOSTED_URL": {
                      "isOptional": false,
                      "description": "Mirrors CONVEX_CLOUD_ORIGIN — some tooling reads this name instead.",
                      "defaultValue": "${{CONVEX_CLOUD_ORIGIN}}"
                    },
                    "PUBLIC_CONVEX_SITE_ORIGIN": {
                      "isOptional": false,
                      "description": "Publicly reachable HTTP Actions origin, routed through Railway's TCP proxy on port 3211.",
                      "defaultValue": "http://${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}"
                    },
                    "PRIVATE_CONVEX_SITE_ORIGIN": {
                      "isOptional": false,
                      "description": "Internal-only HTTP Actions origin.",
                      "defaultValue": "http://${{RAILWAY_PRIVATE_DOMAIN}}:3211"
                    },
                    "PUBLIC_CONVEX_CLOUD_ORIGIN": {
                      "isOptional": false,
                      "description": "Publicly reachable Cloud API origin — what your deployed frontend actually talks to by default.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "PRIVATE_CONVEX_CLOUD_ORIGIN": {
                      "isOptional": false,
                      "description": "Internal-only Cloud API origin, reachable only from other services in this Railway project.",
                      "defaultValue": "http://${{RAILWAY_PRIVATE_DOMAIN}}:3210"
                    },
                    "CONVEX_SELF_HOSTED_ADMIN_KEY": {
                      "isOptional": false,
                      "description": "Starts as invalid so the backend generates a real key on first boot and prints it to the deploy logs. Paste the generated value back here once you have it — see README.",
                      "defaultValue": "invalid"
                    }
                  },
                  "networking": {
                    "tcpProxies": {
                      "3211": {}
                    },
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  },
                  "volumeMounts": {
                    "0cb836dd-c596-4ee4-8cd5-b8cbfbe64135": {
                      "mountPath": "/convex/data"
                    }
                  }
                },
                "8bd2e6a5-9bf0-42c1-8325-bacfdf91771c": {
                  "icon": "https://devicons.railway.app/i/postgresql.svg",
                  "name": "Postgres",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "postgres:17"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Where Postgres stores its data files inside the volume.",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Private network hostname for this Postgres instance.",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "Standard Postgres port.",
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "Username, mirrored for PG*-convention tools.",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGSSLMODE": {
                      "isOptional": false,
                      "description": "Disables SSL for connections — safe here since traffic stays on Railway's private network, never the public internet.",
                      "defaultValue": "disable"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "Default database name — also used as INSTANCE_NAME on the Backend service.",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "Password, mirrored for tools that read the PG* convention instead of POSTGRES_*.",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Database created on first boot.",
                      "defaultValue": "railway"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Standard full connection string, private network.",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Default Postgres superuser.",
                      "defaultValue": "postgres"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": false,
                      "description": "Validity period for the self-signed cert Postgres generates internally.",
                      "defaultValue": "820"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Auto-generated password for the default Postgres user.",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "CONVEX_DATABASE_URL": {
                      "isOptional": false,
                      "description": "The exact connection string the Convex Backend service reads via its own POSTGRES_URL variable.",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:${{PGPORT}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Grace period Railway gives this service to shut down cleanly before force-killing it — avoids cutting off in-flight queries during a redeploy.",
                      "defaultValue": "60"
                    }
                  },
                  "volumeMounts": {
                    "8bd2e6a5-9bf0-42c1-8325-bacfdf91771c": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "Convex Dashboard",
      "method": "GET",
      "path": "/",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 3,
    "needs_volume": true
  },
  "generated_at": "2026-09-26T10:14:47.613Z",
  "generator_version": "0.1.0",
  "status": "degraded",
  "validated_at": "2026-09-26T10:08:07.859Z",
  "success_rate_30d": 0,
  "validation": {
    "last_run_id": "run_a97b3b99575a4455af59",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": false,
        "detail": "SUCCESS,FAILED,DEPLOYING"
      }
    ]
  }
}
