Skip to content

Self-host Matomo

updated Sep 2026prices checked · Jul 2026Install verified on Ubuntu 26.04 · Sep 2026 · how we test
We earn commissions when you shop through the links below. Full disclosure →

The full-featured Google Analytics alternative — goals, e-commerce tracking, and 100% data ownership, with funnels and heatmaps available as paid premium plugins. Heavier than Plausible, but the closest like-for-like replacement for GA's depth.

Key facts

LicenseGPL-3.0-or-later
StackPHP, MariaDB
Min RAM2048 MB
Official imageyes
Measured idle RAM138 MB
Difficulty
Our recommendation

Pick Matomo when you are replacing Google Analytics wholesale and want the data in your own MariaDB: goals, segments, raw visit logs and a plugin marketplace, GPL-3.0-or-later, at 5.13.0 (as of September 2026) with an official-library Docker image. The price is hardware and upkeep: upstream's minimum for up to 100,000 pageviews a month is 2 CPU, 2 GB of RAM and a 50 GB SSD, and once traffic is real you must run report archiving from cron. The headline behavioural tools — Funnels, Heatmap & Session Recording, A/B Testing, Form Analytics, Custom Reports — are paid premium plugins, not part of the GPL core.

Follow the Matomo deploy guide →

What you need

  • Any VPS with at least 2048 MB of RAM
  • A domain you control — most self-hosted setups need HTTPS in front of them
  • About an afternoon — budget time for troubleshooting
Where to host itaffiliate disclosure
Hetzner Cloudrun it on
From $23.59/mo · 2 vCPU / 4 GB / 80 GB · EU + US
Get Hetzner Cloud (opens in new tab)
Kamaterafree trial
From $4/mo · 1 vCPU / 1 GB / 20 GB · US + EU + Asia
Start free on Kamatera → (opens in new tab)
DigitalOceanalso works on
From $6/mo · 1 vCPU / 1 GB / 25 GB · US + EU + Asia
Deploy on DigitalOcean → (opens in new tab)

Paid link — we earn a commission if you shop through it.

Install with Docker Compose

Save this as compose.yml and run docker compose up -d:

# Matomo — analytics with a MariaDB backend
services:
  db:
    image: mariadb:11
    environment:
      MARIADB_ROOT_PASSWORD: changeme
      MARIADB_DATABASE: matomo
      MARIADB_USER: matomo
      MARIADB_PASSWORD: changeme
    volumes: ["./db:/var/lib/mysql"]
  matomo:
    image: matomo:latest
    ports: ["8080:80"]
    depends_on: [db]
    environment:
      MATOMO_DATABASE_HOST: db
      MATOMO_DATABASE_USERNAME: matomo
      MATOMO_DATABASE_PASSWORD: changeme
      MATOMO_DATABASE_DBNAME: matomo
    volumes: ["./matomo:/var/www/html"]
# docker compose up -d  →  http://SERVER_IP:8080  (DB host = db)

What you take on

Matomo's own requirements and FAQ pages are where the cost shows up:

non-negotiableSizing is upstream's, not ours: "2 CPU, 2 GB RAM, 50GB SSD disk" for up to 100,000 pageviews a month, 4 CPU / 8 GB / 250 GB for up to a million, and "at least two servers" beyond that. Our 2 GB floor is that first tier for app and MariaDB together.
non-negotiableSet up archiving before you need it. Past "a few hundreds visits per day" the FAQ says to run console core:archive hourly from cron and set browser_archiving_disabled_enforce = 1, or users get sluggish dashboards and "Oops, there was an error with the request" — and clicking again "just exacerbates the problem". The official image's README has no archiving schedule of its own, so in Docker our advice is a second container (or host cron) running the archive command.
non-negotiableFloors are rising: Matomo 5 wants PHP 8, and the Matomo 6.0 beta requires PHP >= 8.1 and MySQL >= 8.0 or MariaDB >= 10.6. Our snippet's mariadb:11 clears that; a hand-installed older database may not.
non-negotiableFunnels, Heatmap & Session Recording, A/B Testing, Form Analytics, Custom Reports and Login SAML are premium plugins on the Marketplace. Compare what you actually used in GA against the free core before committing.
non-negotiableThe security guide says always use HTTPS (login, password and token_auth: "This information is regularly included in the responses from the Matomo server"), back up the database and config/config.ini.php together, and — if you lock down file permissions — set enable_auto_update = 0 and update manually. Behind a proxy, configure the proxy-header IP setting or every visit is your proxy.

An alternative to

Head-to-head

More in Web analytics

Web analytics

GoatCounter

The smallest serious web analytics server: a single statically compiled Go binary (or the project's own Docker image) writing to a SQLite file, with PostgreSQL optional for big sites. It counts unique visits without cookies or identifiers, tracks referrers, campaigns, browsers, locations and screen sizes, and offers a JavaScript-free tracking pixel, a backend API, and log-file import. Its own README says it doesn't need a GDPR notice. Licensed EUPL-1.2; the same author runs a free hosted service.
GoSQLite
easyRead guide →
Web analytics

OpenPanel

An open-source web and product analytics platform that pitches itself as "the power of Mixpanel with the ease of Plausible": funnels, cohorts, user profiles, session history and replay, A/B tests, revenue tracking, real-time dashboards, and SDKs for web, iOS/Android and server-side events — cookieless. Licensed AGPL-3.0; the documented install clones a dedicated git branch, a setup quiz writes .env, and a start script brings up seven containers (Caddy, PostgreSQL, Redis, ClickHouse, API, dashboard, worker). Free to self-host with unlimited events, per its pricing page.
TypeScriptNext.jsFastifyPostgreSQLClickHouseRedis
moderateRead guide →
Web analytics

Plausible

Lightweight, privacy-friendly web analytics in a single dashboard — no cookies, no personal data, GDPR-friendly by default. The Google Analytics replacement you can actually read.
ElixirClickHousePostgreSQL
moderateRead guide →
Web analytics

Rybbit

An open-source, privacy-friendly Google Analytics alternative that goes further than a pageview dashboard: sessions, unique users, bounce rate, real-time view, goals, retention, user journeys, funnels, session replays, custom events with JSON properties, and country → region → city maps — no cookies. Licensed AGPL-3.0 and installed by one setup script that starts Caddy, ClickHouse, PostgreSQL, Redis and the two app containers; it needs a domain pointed at the server because its tracking script must be served over HTTPS.
TypeScriptClickHousePostgreSQLRedis
easyRead guide →

We use analytics cookies (Google Analytics, PostHog) to see which guides are useful. No ad networks, no cross-site tracking. See our privacy policy.