{
  "manifest_version": "1.0.0",
  "template": {
    "id": "ed26caea-864e-4965-b8a6-102e7d24675f",
    "slug": "deploy-plausible-vs-matomo-analytics",
    "name": "Plausible vs Matomo",
    "description": "Lightweight Plausible CE vs full-suite Matomo",
    "url": "https://railway.com/deploy/deploy-plausible-vs-matomo-analytics",
    "upstream": {
      "image": "ghcr.io/plausible/community-edition:v3.2.1"
    }
  },
  "services": [
    {
      "name": "plausible",
      "source": {
        "image": "ghcr.io/plausible/community-edition:v3.2.1"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/plausible",
      "http": true
    },
    {
      "name": "ClickHouse",
      "source": {
        "image": "clickhouse/clickhouse-server:24.12-alpine"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/clickhouse",
      "http": false
    },
    {
      "name": "Postgres",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "plausible",
      "description": "Port the Plausible web server listens on",
      "secret": false,
      "strategy": "default",
      "default": "8000"
    },
    {
      "key": "TMPDIR",
      "service": "plausible",
      "description": "Temporary files directory on the volume",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/plausible/tmp"
    },
    {
      "key": "BASE_URL",
      "service": "plausible",
      "description": "Public URL of your Plausible instance",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "HTTP_PORT",
      "service": "plausible",
      "description": "HTTP port for Plausible",
      "secret": false,
      "strategy": "default",
      "default": "8000"
    },
    {
      "key": "LISTEN_IP",
      "service": "plausible",
      "description": "IP address Plausible binds to",
      "secret": false,
      "strategy": "default",
      "default": "::"
    },
    {
      "key": "DATABASE_URL",
      "service": "plausible",
      "description": "Postgres connection string for Plausible",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "ECTO_CH_IPV6",
      "service": "plausible",
      "description": "Use IPv6 to reach ClickHouse over private network",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "TOTP_VAULT_KEY",
      "service": "plausible",
      "description": "Key that encrypts 2FA secrets; keep stable",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "RAILWAY_RUN_UID",
      "service": "plausible",
      "description": "Run as root so the volume is writable",
      "secret": false,
      "strategy": "default",
      "default": "0"
    },
    {
      "key": "SECRET_KEY_BASE",
      "service": "plausible",
      "description": "Secret used to sign sessions; keep stable",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "DISABLE_REGISTRATION",
      "service": "plausible",
      "description": "Registration mode, e.g. invite_only",
      "secret": false,
      "strategy": "default",
      "default": "invite_only"
    },
    {
      "key": "CLICKHOUSE_DATABASE_URL",
      "service": "plausible",
      "description": "ClickHouse connection URL for event storage",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "ENABLE_EMAIL_VERIFICATION",
      "service": "plausible",
      "description": "Require email verification on signup",
      "secret": false,
      "strategy": "default",
      "default": "false"
    },
    {
      "key": "CLICKHOUSE_DB",
      "service": "ClickHouse",
      "description": "ClickHouse database for Plausible events",
      "secret": false,
      "strategy": "default",
      "default": "plausible_events_db"
    },
    {
      "key": "CLICKHOUSE_USER",
      "service": "ClickHouse",
      "description": "ClickHouse user name",
      "secret": false,
      "strategy": "default",
      "default": "plausible"
    },
    {
      "key": "CLICKHOUSE_PASSWORD",
      "service": "ClickHouse",
      "description": "ClickHouse user password",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT",
      "service": "ClickHouse",
      "description": "Enable SQL access management for the default user",
      "secret": false,
      "strategy": "default",
      "default": "1"
    },
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Postgres data directory path",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "Postgres",
      "description": "Postgres host on the private network",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "Postgres",
      "description": "Postgres port",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "Postgres",
      "description": "Postgres user name",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "Postgres",
      "description": "Postgres database name",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "Postgres",
      "description": "Postgres user password",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Default database created on first boot",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "DATABASE_URL",
      "service": "Postgres",
      "description": "Postgres connection string",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Postgres superuser name",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "SSL_CERT_DAYS",
      "service": "Postgres",
      "description": "Validity in days of the self-signed SSL certificate",
      "secret": false,
      "strategy": "default",
      "default": "820"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Postgres superuser password",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Postgres",
      "description": "Seconds to wait for graceful shutdown on redeploy",
      "secret": false,
      "strategy": "default",
      "default": "60"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "deploy-plausible-vs-matomo-analytics"
      }
    },
    "cli": "railway deploy --template deploy-plausible-vs-matomo-analytics",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "ed26caea-864e-4965-b8a6-102e7d24675f",
            "serializedConfig": {
              "services": {
                "1bd317e6-568c-4a60-97e7-5337244ff125": {
                  "icon": null,
                  "name": "plausible",
                  "deploy": {
                    "startCommand": "sh -c \"/entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh run\"",
                    "healthcheckPath": "/api/health",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/plausible/community-edition:v3.2.1"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Port the Plausible web server listens on",
                      "defaultValue": "8000"
                    },
                    "TMPDIR": {
                      "isOptional": false,
                      "description": "Temporary files directory on the volume",
                      "defaultValue": "/var/lib/plausible/tmp"
                    },
                    "BASE_URL": {
                      "isOptional": false,
                      "description": "Public URL of your Plausible instance",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "HTTP_PORT": {
                      "isOptional": false,
                      "description": "HTTP port for Plausible",
                      "defaultValue": "8000"
                    },
                    "LISTEN_IP": {
                      "isOptional": false,
                      "description": "IP address Plausible binds to",
                      "defaultValue": "::"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Postgres connection string for Plausible",
                      "defaultValue": "${{Postgres.DATABASE_URL}}"
                    },
                    "ECTO_CH_IPV6": {
                      "isOptional": false,
                      "description": "Use IPv6 to reach ClickHouse over private network",
                      "defaultValue": "true"
                    },
                    "TOTP_VAULT_KEY": {
                      "isOptional": false,
                      "description": "Key that encrypts 2FA secrets; keep stable",
                      "defaultValue": "{{TOTP_VAULT_KEY}}"
                    },
                    "RAILWAY_RUN_UID": {
                      "isOptional": false,
                      "description": "Run as root so the volume is writable",
                      "defaultValue": "0"
                    },
                    "SECRET_KEY_BASE": {
                      "isOptional": false,
                      "description": "Secret used to sign sessions; keep stable",
                      "defaultValue": "{{SECRET_KEY_BASE}}"
                    },
                    "DISABLE_REGISTRATION": {
                      "isOptional": false,
                      "description": "Registration mode, e.g. invite_only",
                      "defaultValue": "invite_only"
                    },
                    "CLICKHOUSE_DATABASE_URL": {
                      "isOptional": false,
                      "description": "ClickHouse connection URL for event storage",
                      "defaultValue": "http://${{ClickHouse.CLICKHOUSE_USER}}:${{ClickHouse.CLICKHOUSE_PASSWORD}}@${{ClickHouse.RAILWAY_PRIVATE_DOMAIN}}:8123/${{ClickHouse.CLICKHOUSE_DB}}"
                    },
                    "ENABLE_EMAIL_VERIFICATION": {
                      "isOptional": false,
                      "description": "Require email verification on signup",
                      "defaultValue": "false"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  },
                  "volumeMounts": {
                    "1bd317e6-568c-4a60-97e7-5337244ff125": {
                      "mountPath": "/var/lib/plausible"
                    }
                  }
                },
                "7c82df32-f278-4ce1-b777-759779760c07": {
                  "icon": null,
                  "name": "ClickHouse",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "clickhouse/clickhouse-server:24.12-alpine"
                  },
                  "variables": {
                    "CLICKHOUSE_DB": {
                      "isOptional": false,
                      "description": "ClickHouse database for Plausible events",
                      "defaultValue": "plausible_events_db"
                    },
                    "CLICKHOUSE_USER": {
                      "isOptional": false,
                      "description": "ClickHouse user name",
                      "defaultValue": "plausible"
                    },
                    "CLICKHOUSE_PASSWORD": {
                      "isOptional": false,
                      "description": "ClickHouse user password",
                      "defaultValue": "{{CLICKHOUSE_PASSWORD}}"
                    },
                    "CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT": {
                      "isOptional": false,
                      "description": "Enable SQL access management for the default user",
                      "defaultValue": "1"
                    }
                  },
                  "volumeMounts": {
                    "7c82df32-f278-4ce1-b777-759779760c07": {
                      "mountPath": "/var/lib/clickhouse"
                    }
                  }
                },
                "a39d47d7-0cb2-4479-938c-933dca5ed05b": {
                  "icon": "https://devicons.railway.app/i/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": "Postgres data directory path",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Postgres host on the private network",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "Postgres port",
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "Postgres user name",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "Postgres database name",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "Postgres user password",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Default database created on first boot",
                      "defaultValue": "railway"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Postgres connection string",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Postgres superuser name",
                      "defaultValue": "postgres"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": false,
                      "description": "Validity in days of the self-signed SSL certificate",
                      "defaultValue": "820"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Postgres superuser password",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Seconds to wait for graceful shutdown on redeploy",
                      "defaultValue": "60"
                    }
                  },
                  "volumeMounts": {
                    "a39d47d7-0cb2-4479-938c-933dca5ed05b": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "plausible",
      "method": "GET",
      "path": "/api/health",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 3,
    "needs_volume": true
  },
  "generated_at": "2026-10-17T04:14:47.046Z",
  "generator_version": "0.1.0",
  "status": "degraded",
  "validated_at": "2026-10-17T02:26:06.999Z",
  "success_rate_30d": 0,
  "validation": {
    "last_run_id": "run_8d5a74f87a1f4b6581ea",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": false,
        "detail": "FAILED,SUCCESS,SUCCESS"
      }
    ]
  }
}
