{
  "manifest_version": "1.0.0",
  "template": {
    "id": "164e14b1-0bfb-4613-80bf-ac3d382208d9",
    "slug": "plausible-v3-privacy-first-analytics",
    "name": "Plausible v3 Privacy-First Analytics",
    "description": "Cookie-free, lightweight web analytics you own, powered by ClickHouse.",
    "url": "https://railway.com/deploy/plausible-v3-privacy-first-analytics",
    "upstream": {
      "image": "ghcr.io/plausible/community-edition:v3.2.1"
    }
  },
  "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": "clickhouse",
      "source": {
        "repo": "https://github.com/baranberkay96/plausible-railway"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/clickhouse",
      "http": false
    },
    {
      "name": "plausible",
      "source": {
        "image": "ghcr.io/plausible/community-edition:v3.2.1"
      },
      "needs_volume": false,
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Location where the database will be initialized",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "Postgres",
      "description": "Railway Private Domain Name.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "Postgres",
      "description": "Port to connect to Postgres.",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "Postgres",
      "description": "Required variable for Data panel",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "Postgres",
      "description": "Required variable for the data panel.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "Postgres",
      "description": "Required variable for Data panel",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Default database created when image is started.",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "DATABASE_URL",
      "service": "Postgres",
      "description": "URL to connect to Postgres database.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "User to connect to Postgres DB",
      "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": "Password to connect to DB",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Postgres",
      "description": "Allow Postgres to cleanly shut down",
      "secret": false,
      "strategy": "default",
      "default": "60"
    },
    {
      "key": "PORT",
      "service": "clickhouse",
      "description": "ClickHouse HTTP port; Railway probes /ping.",
      "secret": false,
      "strategy": "default",
      "default": "8123"
    },
    {
      "key": "CLICKHOUSE_DB",
      "service": "clickhouse",
      "description": "Events database created on first boot.",
      "secret": false,
      "strategy": "default",
      "default": "plausible_events_db"
    },
    {
      "key": "CLICKHOUSE_USER",
      "service": "clickhouse",
      "description": "User created by the official entrypoint (replaces the passwordless default user).",
      "secret": false,
      "strategy": "default",
      "default": "plausible"
    },
    {
      "key": "CLICKHOUSE_PASSWORD",
      "service": "clickhouse",
      "description": "Password for CLICKHOUSE_USER (alphanumeric, URL-safe).",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "clickhouse",
      "description": "Time ClickHouse gets to flush and stop cleanly.",
      "secret": false,
      "strategy": "default",
      "default": "60"
    },
    {
      "key": "CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT",
      "service": "clickhouse",
      "description": "SQL user management off; Plausible does not need it.",
      "secret": false,
      "strategy": "default",
      "default": "0"
    },
    {
      "key": "PORT",
      "service": "plausible",
      "description": "HTTP port (Plausible reads PORT when HTTP_PORT is unset).",
      "secret": false,
      "strategy": "default",
      "default": "8000"
    },
    {
      "key": "BASE_URL",
      "service": "plausible",
      "description": "Public URL of this instance. Change when you add a custom domain.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "DATABASE_URL",
      "service": "plausible",
      "description": "Postgres (users, sites, settings).",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "TOTP_VAULT_KEY",
      "service": "plausible",
      "description": "Base64 32-byte key that encrypts 2FA secrets at rest. Never change after first boot.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "CLICKHOUSE_HOST",
      "service": "plausible",
      "description": "Used by the start command to wait for ClickHouse.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "SECRET_KEY_BASE",
      "service": "plausible",
      "description": "Signs sessions/cookies (>= 64 bytes). Never change after first boot.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "DISABLE_REGISTRATION",
      "service": "plausible",
      "description": "true | false | invite_only. CE default: the first account can register, afterwards invite-only.",
      "secret": false,
      "strategy": "default",
      "default": "invite_only"
    },
    {
      "key": "CLICKHOUSE_DATABASE_URL",
      "service": "plausible",
      "description": "ClickHouse (events, sessions) over the private network.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "ENABLE_EMAIL_VERIFICATION",
      "service": "plausible",
      "description": "Require email verification for new users (needs working email).",
      "secret": false,
      "strategy": "default",
      "default": "false"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "plausible-v3-privacy-first-analytics"
      }
    },
    "cli": "railway deploy --template plausible-v3-privacy-first-analytics",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "164e14b1-0bfb-4613-80bf-ac3d382208d9",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "0fcef8d7-0c4c-5968-be6a-3dfdda541e50": {
                  "icon": "https://devicons.railway.app/i/postgresql.svg",
                  "name": "Postgres",
                  "deploy": {
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Location where the database will be initialized",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Railway Private Domain Name.",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "Port to connect to Postgres.",
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "Required variable for Data panel",
                      "defaultValue": "${{ POSTGRES_USER }}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "Required variable for the data panel.",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "Required variable for Data panel",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Default database created when image is started.",
                      "defaultValue": "railway"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "URL to connect to Postgres database.",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "User to connect to Postgres DB",
                      "defaultValue": "postgres"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": true,
                      "description": "SSL certificate expiry in days.",
                      "defaultValue": "820"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Password to connect to DB",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Allow Postgres to cleanly shut down",
                      "defaultValue": "60"
                    }
                  },
                  "networking": {
                    "tcpProxies": {},
                    "serviceDomains": {}
                  },
                  "volumeMounts": {
                    "fa0c1a30-3d35-5a6d-b3ff-0d51c2733617": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                },
                "80f055b6-38cb-5072-8d7c-5d94b3eefe13": {
                  "icon": "https://devicons.railway.com/i/clickhouse.svg",
                  "name": "clickhouse",
                  "build": {
                    "builder": "DOCKERFILE"
                  },
                  "deploy": {
                    "healthcheckPath": "/ping",
                    "restartPolicyType": "ON_FAILURE",
                    "healthcheckTimeout": 300,
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "baranberkay96/plausible-railway",
                    "branch": "main",
                    "rootDirectory": "/services/clickhouse"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": true,
                      "description": "ClickHouse HTTP port; Railway probes /ping.",
                      "defaultValue": "8123"
                    },
                    "CLICKHOUSE_DB": {
                      "isOptional": false,
                      "description": "Events database created on first boot.",
                      "defaultValue": "plausible_events_db"
                    },
                    "CLICKHOUSE_USER": {
                      "isOptional": false,
                      "description": "User created by the official entrypoint (replaces the passwordless default user).",
                      "defaultValue": "plausible"
                    },
                    "CLICKHOUSE_PASSWORD": {
                      "isOptional": false,
                      "description": "Password for CLICKHOUSE_USER (alphanumeric, URL-safe).",
                      "defaultValue": "{{CLICKHOUSE_PASSWORD}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": true,
                      "description": "Time ClickHouse gets to flush and stop cleanly.",
                      "defaultValue": "60"
                    },
                    "CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT": {
                      "isOptional": true,
                      "description": "SQL user management off; Plausible does not need it.",
                      "defaultValue": "0"
                    }
                  },
                  "networking": {
                    "tcpProxies": {},
                    "serviceDomains": {}
                  },
                  "volumeMounts": {
                    "922ca363-d7ce-59a6-9460-202339cac4bc": {
                      "mountPath": "/var/lib/clickhouse"
                    }
                  }
                },
                "b4f97918-7cf2-57d8-8ee6-808421d13fe1": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/plausible.svg",
                  "name": "plausible",
                  "deploy": {
                    "startCommand": "/bin/sh -c 'i=0; until wget -q -O /dev/null \"http://${CLICKHOUSE_HOST}:8123/ping\"; do i=$((i+1)); [ \"$i\" -ge 100 ] && echo \"ClickHouse not reachable\" && exit 1; echo \"waiting for ClickHouse ($i)\"; sleep 3; done; /entrypoint.sh db createdb && /entrypoint.sh db migrate && exec /entrypoint.sh run'",
                    "healthcheckPath": "/api/health",
                    "restartPolicyType": "ON_FAILURE",
                    "healthcheckTimeout": 600,
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/plausible/community-edition:v3.2.1"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": true,
                      "description": "HTTP port (Plausible reads PORT when HTTP_PORT is unset).",
                      "defaultValue": "8000"
                    },
                    "BASE_URL": {
                      "isOptional": false,
                      "description": "Public URL of this instance. Change when you add a custom domain.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Postgres (users, sites, settings).",
                      "defaultValue": "${{Postgres.DATABASE_URL}}"
                    },
                    "TOTP_VAULT_KEY": {
                      "isOptional": false,
                      "description": "Base64 32-byte key that encrypts 2FA secrets at rest. Never change after first boot.",
                      "defaultValue": "{{TOTP_VAULT_KEY}}"
                    },
                    "CLICKHOUSE_HOST": {
                      "isOptional": true,
                      "description": "Used by the start command to wait for ClickHouse.",
                      "defaultValue": "${{clickhouse.RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "SECRET_KEY_BASE": {
                      "isOptional": false,
                      "description": "Signs sessions/cookies (>= 64 bytes). Never change after first boot.",
                      "defaultValue": "{{SECRET_KEY_BASE}}"
                    },
                    "DISABLE_REGISTRATION": {
                      "isOptional": true,
                      "description": "true | false | invite_only. CE default: the first account can register, afterwards invite-only.",
                      "defaultValue": "invite_only"
                    },
                    "CLICKHOUSE_DATABASE_URL": {
                      "isOptional": false,
                      "description": "ClickHouse (events, sessions) over the private network.",
                      "defaultValue": "http://${{clickhouse.CLICKHOUSE_USER}}:${{clickhouse.CLICKHOUSE_PASSWORD}}@${{clickhouse.RAILWAY_PRIVATE_DOMAIN}}:8123/${{clickhouse.CLICKHOUSE_DB}}"
                    },
                    "ENABLE_EMAIL_VERIFICATION": {
                      "isOptional": true,
                      "description": "Require email verification for new users (needs working email).",
                      "defaultValue": "false"
                    }
                  },
                  "networking": {
                    "tcpProxies": {},
                    "serviceDomains": {
                      "<hasDomain>:8000": {
                        "port": 8000
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "plausible",
      "method": "GET",
      "path": "/api/health",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 3,
    "needs_volume": true
  },
  "generated_at": "2026-10-11T16:14:40.554Z",
  "generator_version": "0.1.0",
  "status": "degraded",
  "validated_at": "2026-10-11T14:43:13.845Z",
  "success_rate_30d": 0,
  "validation": {
    "last_run_id": "run_ef9f16328ad345a4aef2",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": false,
        "detail": "SUCCESS,DEPLOYING,SUCCESS"
      }
    ]
  }
}
