{
  "manifest_version": "1.0.0",
  "template": {
    "id": "841f0ca9-f13f-452f-956c-8194f3321756",
    "slug": "matomo-analytics",
    "name": "Matomo",
    "description": "Web analytics platform for tracking visitors to your websites",
    "url": "https://railway.com/deploy/matomo-analytics",
    "upstream": {
      "repo_url": "https://github.com/gridalpha/matomo-railway"
    }
  },
  "services": [
    {
      "name": "MySQL",
      "source": {
        "image": "mysql:9.4"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/mysql",
      "http": false
    },
    {
      "name": "matomo",
      "source": {
        "repo": "https://github.com/gridalpha/matomo-railway"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/www/html",
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "MYSQLHOST",
      "service": "MySQL",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "MYSQLPORT",
      "service": "MySQL",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "default",
      "default": "3306"
    },
    {
      "key": "MYSQLUSER",
      "service": "MySQL",
      "description": "Data panel alias for the superuser",
      "secret": false,
      "strategy": "default",
      "default": "root"
    },
    {
      "key": "MYSQL_URL",
      "service": "MySQL",
      "description": "Private connection string",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "MYSQLDATABASE",
      "service": "MySQL",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "MYSQLPASSWORD",
      "service": "MySQL",
      "description": "Data panel alias, not read by the server",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "MYSQL_DATABASE",
      "service": "MySQL",
      "description": "Database created on first boot",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "MYSQL_ROOT_PASSWORD",
      "service": "MySQL",
      "description": "Superuser password, read by the server",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "PORT",
      "service": "matomo",
      "description": "Apache listening port",
      "secret": false,
      "strategy": "default",
      "default": "80"
    },
    {
      "key": "PHP_MEMORY_LIMIT",
      "service": "matomo",
      "description": "PHP memory ceiling",
      "secret": false,
      "strategy": "default",
      "default": "512M"
    },
    {
      "key": "MATOMO_DATABASE_HOST",
      "service": "matomo",
      "description": "Private MySQL hostname",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "MATOMO_DATABASE_DBNAME",
      "service": "matomo",
      "description": "Database created at boot",
      "secret": false,
      "strategy": "default",
      "default": "matomo"
    },
    {
      "key": "MATOMO_DATABASE_PASSWORD",
      "service": "matomo",
      "description": "Password for that account",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "MATOMO_DATABASE_USERNAME",
      "service": "matomo",
      "description": "Least-privilege account created at boot",
      "secret": false,
      "strategy": "default",
      "default": "matomo"
    },
    {
      "key": "MATOMO_DATABASE_ADMIN_URL",
      "service": "matomo",
      "description": "Provisions database and user at boot",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "MATOMO_DATABASE_TABLES_PREFIX",
      "service": "matomo",
      "description": "Prefix for Matomo's tables",
      "secret": false,
      "strategy": "default",
      "default": "matomo_"
    },
    {
      "key": "MATOMO_ARCHIVE_INTERVAL_SECONDS",
      "service": "matomo",
      "description": "How often reports are re-archived",
      "secret": false,
      "strategy": "default",
      "default": "3600"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "matomo-analytics"
      }
    },
    "cli": "railway deploy --template matomo-analytics",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "841f0ca9-f13f-452f-956c-8194f3321756",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "0f3e1b72-b588-4807-8594-6a72bfedf6bf": {
                  "icon": "https://devicons.railway.app/i/mysql.svg",
                  "name": "MySQL",
                  "deploy": {
                    "startCommand": "docker-entrypoint.sh mysqld --innodb-use-native-aio=0 --disable-log-bin --performance_schema=0 --innodb-buffer-pool-size=1G",
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "mysql:9.4"
                  },
                  "variables": {
                    "MYSQLHOST": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "MYSQLPORT": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "3306"
                    },
                    "MYSQLUSER": {
                      "isOptional": false,
                      "description": "Data panel alias for the superuser",
                      "defaultValue": "root"
                    },
                    "MYSQL_URL": {
                      "isOptional": false,
                      "description": "Private connection string",
                      "defaultValue": "mysql://${{ MYSQLUSER }}:${{ MYSQL_ROOT_PASSWORD }}@${{ RAILWAY_PRIVATE_DOMAIN }}:3306/${{ MYSQL_DATABASE }}"
                    },
                    "MYSQLDATABASE": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{ MYSQL_DATABASE }}"
                    },
                    "MYSQLPASSWORD": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{ MYSQL_ROOT_PASSWORD }}"
                    },
                    "MYSQL_DATABASE": {
                      "isOptional": false,
                      "description": "Database created on first boot",
                      "defaultValue": "railway"
                    },
                    "MYSQL_ROOT_PASSWORD": {
                      "isOptional": false,
                      "description": "Superuser password, read by the server",
                      "defaultValue": "{{MYSQL_ROOT_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "0f3e1b72-b588-4807-8594-6a72bfedf6bf": {
                      "mountPath": "/var/lib/mysql"
                    }
                  }
                },
                "c0f10d76-4665-4959-9a8e-8dce64c3633c": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/matomo.svg",
                  "name": "matomo",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/gridalpha/matomo-railway",
                    "rootDirectory": null
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Apache listening port",
                      "defaultValue": "80"
                    },
                    "PHP_MEMORY_LIMIT": {
                      "isOptional": false,
                      "description": "PHP memory ceiling",
                      "defaultValue": "512M"
                    },
                    "MATOMO_DATABASE_HOST": {
                      "isOptional": false,
                      "description": "Private MySQL hostname",
                      "defaultValue": "${{MySQL.MYSQLHOST}}"
                    },
                    "MATOMO_DATABASE_DBNAME": {
                      "isOptional": false,
                      "description": "Database created at boot",
                      "defaultValue": "matomo"
                    },
                    "MATOMO_DATABASE_PASSWORD": {
                      "isOptional": false,
                      "description": "Password for that account",
                      "defaultValue": "{{MATOMO_DATABASE_PASSWORD}}"
                    },
                    "MATOMO_DATABASE_USERNAME": {
                      "isOptional": false,
                      "description": "Least-privilege account created at boot",
                      "defaultValue": "matomo"
                    },
                    "MATOMO_DATABASE_ADMIN_URL": {
                      "isOptional": false,
                      "description": "Provisions database and user at boot",
                      "defaultValue": "${{MySQL.MYSQL_URL}}"
                    },
                    "MATOMO_DATABASE_TABLES_PREFIX": {
                      "isOptional": false,
                      "description": "Prefix for Matomo's tables",
                      "defaultValue": "matomo_"
                    },
                    "MATOMO_ARCHIVE_INTERVAL_SECONDS": {
                      "isOptional": false,
                      "description": "How often reports are re-archived",
                      "defaultValue": "3600"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:80": {
                        "port": 80
                      }
                    }
                  },
                  "volumeMounts": {
                    "c0f10d76-4665-4959-9a8e-8dce64c3633c": {
                      "mountPath": "/var/www/html"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-20T16:14:49.616Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-19T14:00:35.191Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_956871f1962c45749da2",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 131,
    "typical_build_seconds": 51,
    "typical_start_seconds": 10,
    "slowest_service": "matomo"
  }
}
