{
  "manifest_version": "1.0.0",
  "template": {
    "id": "2cb94cdb-58de-4a51-958b-9feac8811147",
    "slug": "matomo-web-analytics",
    "name": "Matomo | Open-Source Privacy First Google Analytics Alternative",
    "description": "Self Host Matomo. Web analytics, GDPR compliant with full data ownership",
    "url": "https://railway.com/deploy/matomo-web-analytics",
    "upstream": {
      "image": "matomo:latest"
    }
  },
  "services": [
    {
      "name": "Matomo",
      "source": {
        "image": "matomo:latest"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/www/html",
      "http": true
    },
    {
      "name": "MySQL",
      "source": {
        "image": "mysql:9.4"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/mysql",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "Matomo",
      "description": "Apache listening port",
      "secret": false,
      "strategy": "default",
      "default": "80"
    },
    {
      "key": "PHP_MEMORY_LIMIT",
      "service": "Matomo",
      "description": "PHP memory allocation limit",
      "secret": false,
      "strategy": "default",
      "default": "256M"
    },
    {
      "key": "MATOMO_DATABASE_HOST",
      "service": "Matomo",
      "description": "MySQL server hostname",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "MATOMO_DATABASE_DBNAME",
      "service": "Matomo",
      "description": "Database name",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "MATOMO_DATABASE_ADAPTER",
      "service": "Matomo",
      "description": "Database driver type",
      "secret": false,
      "strategy": "default",
      "default": "mysql"
    },
    {
      "key": "MATOMO_DATABASE_PASSWORD",
      "service": "Matomo",
      "description": "Database password",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "MATOMO_DATABASE_USERNAME",
      "service": "Matomo",
      "description": "Database username",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "MATOMO_DATABASE_TABLES_PREFIX",
      "service": "Matomo",
      "description": "Table name prefix",
      "secret": false,
      "strategy": "default",
      "default": "matomo_"
    },
    {
      "key": "MYSQLHOST",
      "service": "MySQL",
      "description": "MySQL internal hostname",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "MYSQLPORT",
      "service": "MySQL",
      "description": "MySQL service port",
      "secret": false,
      "strategy": "default",
      "default": "3306"
    },
    {
      "key": "MYSQLUSER",
      "service": "MySQL",
      "description": "Default MySQL root username",
      "secret": false,
      "strategy": "default",
      "default": "root"
    },
    {
      "key": "MYSQL_URL",
      "service": "MySQL",
      "description": "Internal MySQL connection string",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "MYSQLDATABASE",
      "service": "MySQL",
      "description": "Database name reference variable",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "MYSQLPASSWORD",
      "service": "MySQL",
      "description": "MySQL password reference",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "MYSQL_DATABASE",
      "service": "MySQL",
      "description": "Default database name created",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "MYSQL_PUBLIC_URL",
      "service": "MySQL",
      "description": "Public MySQL connection URL",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "MYSQL_ROOT_PASSWORD",
      "service": "MySQL",
      "description": "Root user password credential",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "matomo-web-analytics"
      }
    },
    "cli": "railway deploy --template matomo-web-analytics",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "2cb94cdb-58de-4a51-958b-9feac8811147",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "71440f26-1127-4004-94f0-41074d736029": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/matomo.svg",
                  "name": "Matomo",
                  "deploy": {
                    "startCommand": "/bin/sh -c 'if [ ! -e /var/www/html/matomo.php ]; then tar cf - -C /usr/src/matomo . | tar xf - -C /var/www/html; chown -R www-data:www-data /var/www/html; fi; a2dismod mpm_event mpm_worker 2>/dev/null; a2enmod mpm_prefork 2>/dev/null; exec apache2-foreground'",
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "matomo:latest"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Apache listening port",
                      "defaultValue": "80"
                    },
                    "PHP_MEMORY_LIMIT": {
                      "isOptional": false,
                      "description": "PHP memory allocation limit",
                      "defaultValue": "256M"
                    },
                    "MATOMO_DATABASE_HOST": {
                      "isOptional": false,
                      "description": "MySQL server hostname",
                      "defaultValue": "${{MySQL.MYSQLHOST}}"
                    },
                    "MATOMO_DATABASE_DBNAME": {
                      "isOptional": false,
                      "description": "Database name",
                      "defaultValue": "${{MySQL.MYSQLDATABASE}}"
                    },
                    "MATOMO_DATABASE_ADAPTER": {
                      "isOptional": false,
                      "description": "Database driver type",
                      "defaultValue": "mysql"
                    },
                    "MATOMO_DATABASE_PASSWORD": {
                      "isOptional": false,
                      "description": "Database password",
                      "defaultValue": "${{MySQL.MYSQLPASSWORD}}"
                    },
                    "MATOMO_DATABASE_USERNAME": {
                      "isOptional": false,
                      "description": "Database username",
                      "defaultValue": "${{MySQL.MYSQLUSER}}"
                    },
                    "MATOMO_DATABASE_TABLES_PREFIX": {
                      "isOptional": false,
                      "description": "Table name prefix",
                      "defaultValue": "matomo_"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  },
                  "volumeMounts": {
                    "71440f26-1127-4004-94f0-41074d736029": {
                      "mountPath": "/var/www/html"
                    }
                  }
                },
                "ab5414c3-92b3-4058-a315-a6b5bb825eb5": {
                  "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": "MySQL internal hostname",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "MYSQLPORT": {
                      "isOptional": false,
                      "description": "MySQL service port",
                      "defaultValue": "3306"
                    },
                    "MYSQLUSER": {
                      "isOptional": false,
                      "description": "Default MySQL root username",
                      "defaultValue": "root"
                    },
                    "MYSQL_URL": {
                      "isOptional": false,
                      "description": "Internal MySQL connection string",
                      "defaultValue": "mysql://${{MYSQLUSER}}:${{MYSQL_ROOT_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:3306/${{MYSQL_DATABASE}}"
                    },
                    "MYSQLDATABASE": {
                      "isOptional": false,
                      "description": "Database name reference variable",
                      "defaultValue": "${{MYSQL_DATABASE}}"
                    },
                    "MYSQLPASSWORD": {
                      "isOptional": false,
                      "description": "MySQL password reference",
                      "defaultValue": "${{MYSQL_ROOT_PASSWORD}}"
                    },
                    "MYSQL_DATABASE": {
                      "isOptional": false,
                      "description": "Default database name created",
                      "defaultValue": "railway"
                    },
                    "MYSQL_PUBLIC_URL": {
                      "isOptional": false,
                      "description": "Public MySQL connection URL",
                      "defaultValue": "mysql://${{MYSQLUSER}}:${{MYSQL_ROOT_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}/${{MYSQL_DATABASE}}"
                    },
                    "MYSQL_ROOT_PASSWORD": {
                      "isOptional": false,
                      "description": "Root user password credential",
                      "defaultValue": "{{MYSQL_ROOT_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "ab5414c3-92b3-4058-a315-a6b5bb825eb5": {
                      "mountPath": "/var/lib/mysql"
                    }
                  },
                  "haTemplateCode": "mysql-ha",
                  "haConversionConfig": {
                    "edge": {
                      "label": "Reverse Proxies",
                      "options": [
                        1,
                        2
                      ],
                      "nodeLabel": "HAProxy",
                      "description": "HAProxy instances routing writes to the primary",
                      "defaultValue": 2
                    },
                    "replica": {
                      "label": "MySQL Replicas",
                      "options": [
                        2,
                        4,
                        6,
                        8
                      ],
                      "nodeLabel": "MySQL",
                      "description": "Requires odd count for quorum",
                      "defaultValue": 2
                    },
                    "internal": null,
                    "description": "This will convert your MySQL instance to an HA cluster with Group Replication failover and HAProxy routing to the primary.",
                    "supportedImageMajorVersions": [
                      8,
                      9
                    ]
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-21T16:15:12.787Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-20T13:50:07.681Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_35f0fba452bc45f39ff3",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 90,
    "typical_build_seconds": 0,
    "typical_start_seconds": 10,
    "slowest_service": "Matomo"
  }
}
