Matomo Self-Hosted Server Requirements, PHP/MySQL Sizing & SMTP Setup Guide
Self-hosting Matomo On-Premise gives your organization 100% ownership over raw analytics data without per-hit SaaS overages or third-party cloud transfers. However, many teams underestimate what happens once traffic crosses a few hundred thousand actions per month: shared hosting slows to a crawl, scheduled email reports silently fail because mail() isn’t authenticated, and un-archived browser requests spike CPU to 100%.
If you already followed my general Matomo Setup Guide or want help architecting a dedicated installation with clean ecommerce and CRM pipelines, review my Matomo Analytics Implementation Service or see Pricing.
Core Software & System Requirements (Matomo 5.x)
Before spinning up a VPS or managed cloud instance, check Matomo’s foundational stack requirements:
- Web Server: Nginx, Apache (with
mod_rewriteenabled for cleaner endpoints), or LiteSpeed over HTTPS (TLS 1.2+). - PHP: PHP 8.1, 8.2, or 8.3 (always verify current Matomo release notes before upgrading to brand-new PHP minor versions).
- Required PHP Extensions:
pdo,pdo_mysql,mysqli,json,libxml,dom,SimpleXML,curl,mbstring,gd,zlib,openssl,ctype,session. - Database: MySQL 8.0+ or MariaDB 10.6+ / 10.11 LTS (InnoDB engine required; UTF8MB4 charset strongly recommended).
- CLI Cron Access: SSH / system cron capability (
crontab -e) — mandatory for disabling expensive browser-triggered report archiving on anything beyond tiny hobby blogs.
Realistic Hardware Sizing by Monthly Actions
An “action” in Matomo equals every pageview, ecommerce item/order interaction, site search, goal hit, and custom event — not just visits. A visitor viewing 6 pages with 4 ecommerce events generates ~10 actions.
| Monthly Traffic Volume | Recommended Setup | Minimum CPU / RAM | Database Setup |
|---|---|---|---|
| Up to 100k actions/mo | Single VPS (App + DB) | 2 vCPU · 2–4 GB RAM · NVMe SSD | Local MariaDB / MySQL (innodb_buffer_pool_size 1 GB) |
| 100k – 1M actions/mo | Single dedicated VPS or App + Managed DB | 4 vCPU · 8 GB RAM · NVMe SSD | innodb_buffer_pool_size 4 GB, CLI Cron Archiving every hour |
| 1M – 5M actions/mo | Dedicated Web Server + Dedicated DB Server | 4–8 vCPU App · 16+ GB RAM DB | Separate DB host, max_allowed_packet >= 64M, Redis/Queued Tracking |
| 5M+ actions/mo | Load-balanced Tracking App + High-IOPS DB + Redis Queue | Multi-node + Dedicated DB (32+ GB RAM) | Matomo QueuedTracking plugin via Redis + dedicated Archiver VM |
Do not install Matomo on a multi-tenant cPanel shared host once you track commercial campaigns or WooCommerce stores — shared IOPS limits will bottleneck matomo_log_link_visit_action writes within weeks.
Critical PHP & Database Tuning (php.ini + my.cnf)
Default Linux package settings routinely cause Matomo archive timeouts and report truncation. Apply these baselines:
Recommended php.ini Overrides
memory_limit = 512M ; Raise to 1024M or 2048M on CLI PHP for large sites
max_execution_time = 300
post_max_size = 64M
upload_max_filesize = 64M
Recommended MySQL / MariaDB Settings
[mysqld]
innodb_buffer_pool_size = 50%_to_70%_of_DB_RAM
max_allowed_packet = 64M
innodb_log_file_size = 256M
wait_timeout = 600
Note that max_allowed_packet = 64M prevents large serialized archive blobs from failing silently during nightly Matomo cron runs.
Mandatory: Enable CLI Cron Archiving
By default, Matomo tries to compute reports on-demand whenever you open the dashboard in your browser. As soon as you have real traffic, turn off browser archiving in Administration (Cog Icon) → System → General Settings → Archiving Settings and set:
- Allow Matomo archiving to trigger when reports are viewed from the browser:
No
Then schedule Matomo’s CLI archiver in your server crontab under the web-server user (e.g., www-data):
5 * * * * www-data /usr/bin/php /var/www/matomo/console core:archive --url=https://analytics.yourdomain.com/ >> /var/log/matomo-archive.log 2>&1
Running core:archive via CLI keeps dashboard page loads sub-second and prevents analytics viewers from stalling HTTP workers.
Matomo SMTP Setup: Fix Missing Scheduled Reports & Password Resets
Out of the box, Matomo defaults to PHP’s local mail() function. On nearly all cloud servers (DigitalOcean, Hetzner, AWS, GCP), unauthenticated port 25/local mail is blocked or flagged directly into spam — meaning password resets, user invitations, alerts, and scheduled PDF/HTML reports never arrive.
Configure authenticated SMTP in Administration → System → General Settings → Email server settings (or directly in config/config.ini.php):
Option A: Via Matomo Admin UI
- Toggle Use SMTP server for email to Yes.
- SMTP Server Address: Hostname from your transactional provider (e.g.,
smtp.postmarkapp.com,smtp-relay.brevo.com,email-smtp.eu-central-1.amazonaws.com, or your Microsoft 365 / Google Workspace relay). - SMTP Port: Typically
587(TLS) or465(SSL). Avoid unencrypted port25. - Authentication Method:
LoginorPlain(depending on provider). - SMTP Username & Password: Paste your API key / SMTP credential (never your personal login password).
- From Email / Noreply Address: Use an address on a domain with valid SPF, DKIM, and DMARC DNS records matching your SMTP sender (e.g.,
analytics@yourdomain.comset vianoreply_email_address).
Option B: Directly in config/config.ini.php
[General]
noreply_email_address = "analytics@yourdomain.com"
[mail]
transport = "smtp"
port = 587
host = "smtp.yourdomain-provider.com"
type = "Login"
username = "your-smtp-username"
password = "your-smtp-password"
encryption = "tls"
After saving, test immediately using Matomo’s CLI mail check or trigger a manual scheduled report (Personal → Email Reports → Send Report now) and verify inbox delivery plus SPF/DKIM alignment.
GDPR, First-Party Subdomain & Data Retention
Deploying Matomo on an EU VPS (e.g., Hetzner Falkenstein/Helsinki or AWS Frankfurt) keeps raw analytics logs in EEA jurisdiction, and serving the script via your own subdomain (stats.yourdomain.com) preserves first-party context — though remember legal compliance still depends on configuring retention, IP anonymization, and consent logic properly! Compare tradeoffs in my Matomo vs GA4 GDPR & Cost Comparison.
Frequently Asked Questions
Can I run Matomo On-Premise on the same server as my WordPress / WooCommerce site?
On low-traffic sites (<50k hits/month), yes — as long as PHP memory and database IOPS are sized properly. For busy stores, isolating Matomo onto a separate small VPS avoids analytics write spikes competing with customer checkout database queries.
Why did my Matomo SMTP test fail with connection timed out on port 587 or 465?
Many cloud providers restrict outbound SMTP ports or block port 25 by default until verified, or a local firewall (ufw / cloud security group) blocks outbound TCP 587/465. Test TCP reachability from your server shell first, verify provider credentials, and confirm your noreply_email_address domain is verified in your SMTP provider.
Does Matomo self-hosted track ecommerce and ad conversions out of the box?
Matomo logs basic pageviews out of the box, but accurate ecommerce funnels, dynamic order values (handling shipping/tax/discounts cleanly), GTM integration, and CRM offline goals require intentional DataLayer and server-side configuration. Reach out via my Free Tracking Audit or review Matomo Analytics Services if you want it configured end to end.
Need this implemented, audited, or white-labeled?
Whether you are an eCommerce brand owner fixing signal loss or a digital marketing agency needing a senior analytics engineer under strict NDA, I deliver 24–48h SLA turnaround with 8.5+ EMQ match rates.

