Overview
Discover what makes Matomo powerful
Matomo (formerly Piwik) is a self‑hosted, open‑source web analytics platform that offers full control over data collection and reporting. From a developer’s standpoint, it is a PHP‑based application that runs on any LAMP/LEMP stack and stores its data in MySQL or MariaDB. The core of the system is a set of PHP classes that expose a rich RESTful API, an event‑driven plugin architecture, and an extensible data layer that can be swapped for alternative storage backends (e.g., ElasticSearch, ClickHouse).
Language & Frameworks
Database
Web Server
Cache
Overview
Matomo (formerly Piwik) is a self‑hosted, open‑source web analytics platform that offers full control over data collection and reporting. From a developer’s standpoint, it is a PHP‑based application that runs on any LAMP/LEMP stack and stores its data in MySQL or MariaDB. The core of the system is a set of PHP classes that expose a rich RESTful API, an event‑driven plugin architecture, and an extensible data layer that can be swapped for alternative storage backends (e.g., ElasticSearch, ClickHouse).
Technical Stack & Architecture
- Language & Frameworks: Pure PHP (≥ 7.2) with a modular MVC‑like structure. Core components are organized in
plugins/andlibs/, enabling hot‑reloadable extensions. - Database: Relational (MySQL 5.5+ / MariaDB) for the core data model; optional support for a dedicated analytics warehouse (e.g., ClickHouse via the Data Warehouse Connector).
- Web Server: Apache, Nginx, or any server capable of serving PHP; the tracker is a lightweight JavaScript snippet that posts to
/piwik.php(or/index.php). - Cache: Built‑in caching layers (file, Redis, or Memcached) for query optimization and session handling.
- Deployment: Docker images are available (official
matomo/matomo), and a DDEV environment is bundled for local development. Kubernetes manifests are also published in the community repository.
Core Capabilities & APIs
- Real‑time Tracking: The JavaScript tracker pushes events via HTTP POST; the backend processes them in near‑real time, populating tables such as
visits,events, andactions. - REST API: Exposes endpoints for reading reports (
/api/?module=API&method=VisitsSummary.get), writing data (via the tracker), and managing configuration (/api/?module=CoreAdminHome&method=Settings.get). - Event System: Developers can hook into
TrackerandReportingevents (Tracker::on('visit', function($event) {})) to inject custom logic or forward data to external services. - Plugin Architecture: Plugins live under
plugins/and can register routes, widgets, reports, and database tables. The plugin API follows a clear contract (initialize(),registerEvents(),getConfig()), allowing third‑party extensions such as GDPR compliance, eCommerce, or custom visualizations. - Data Warehouse Connector: A dedicated plugin that streams raw logs to a columnar store (ClickHouse), enabling high‑performance aggregations and long‑term retention without impacting the primary database.
Deployment & Infrastructure
- Self‑Hosting: Requires a web server, PHP runtime, and MySQL/MariaDB. The installer is wizard‑based but can be scripted; a Composer‑managed source repository allows version pinning.
- Scalability: Horizontal scaling is achieved by load‑balancing the tracker endpoint across multiple PHP workers and replicating the database layer. The Data Warehouse Connector decouples analytics queries from the transactional DB, enabling near‑unlimited read throughput.
- Containerization: Official Docker images expose environment variables for DB credentials, site URLs, and caching options. Compose files are available for multi‑container setups (web + DB + Redis).
- CI/CD: The project publishes GitHub Actions for unit tests and integration tests. Developers can fork the repo, run
./tests/ci.sh, and push PRs that are automatically linted against the test suite.
Integration & Extensibility
- SDKs: Official PHP SDK for server‑side event tracking; community libraries exist for Python, Node.js, and Go.
- Webhooks: Matomo can emit webhooks on specific events (e.g., new visitor, conversion), enabling downstream automation.
- Custom Reports: Developers can create custom report widgets via the API, injecting arbitrary SQL queries or aggregations.
- Theme & UI: The admin UI is built with Twig templates; developers can override views or create new dashboards.
- Internationalization: All strings are i18n‑ready; the plugin system supports adding new locales via PO files.
Developer Experience
- Documentation: The official docs (
developer.matomo.org) cover API reference, plugin development guides, and architecture overviews. Inline code comments are extensive, and the community wiki provides real‑world examples. - Community & Support: Active GitHub issue tracker, Slack channel, and a dedicated forum. The license (GPL v3+) guarantees no vendor lock‑in.
- Testing: PHPUnit test suite covers 80 %+ of core code; continuous integration ensures regressions are caught early.
- Versioning: Semantic versioning with backward‑compatibility guarantees; the
CHANGELOGis machine‑parsable for CI pipelines.
Use Cases
| Scenario | Why Matomo? |
|---|---|
| Privacy‑conscious SaaS | Full data ownership, GDPR compliance out of the box. |
| Enterprise Analytics | Data Warehouse Connector for high‑volume clickstream analysis. |
| Custom Dashboards | Plugin API to expose metrics via Grafana or Kibana. |
| DevOps Monitoring | Webhooks and API enable integration with CI/CD pipelines for real‑time performance metrics. |
| Educational Platforms | Open source nature allows modification of tracking logic for learning analytics |
Open SourceReady to get started?
Join the community and start self-hosting Matomo today
Related Apps in data-analysis
Uptime Kuma
Self-hosted uptime monitoring for all services
Apache Superset
Open‑source BI for fast, no‑code data exploration
Metabase
Easy open‑source business intelligence for everyone
Netron
Visualize AI models in any browser or desktop
Umami
Privacy‑focused, lightweight web analytics
PostHog
Open‑source product analytics and experimentation platform
Weekly Views
Repository Health
Information
Explore More Apps
SimpleX Chat
Private messaging without identifiers
Anchr
Your personal web toolbox for bookmarks, links, and encrypted images
ThingsBoard
Open‑source IoT platform for device management and real‑time data visualization
DebOps
Automate your Debian/Ubuntu data center with Ansible roles
Syndie
Self-hosted apis-services
Plainpad
Secure, self‑hosted note taking for any device