Skip to main content

Best Open Source Alternatives to Amplitude in 2026

·OSSAlt Team
amplitudeproduct-analyticsuser-trackingself-hostedopen-source2026

TL;DR

Amplitude's paid plans start at ~$995/month — after their free tier limit of 50K monthly tracked users. For a growing SaaS with 100K users, that's $12K+/year just for analytics. Open source alternatives have matured significantly. The best: PostHog (closest feature parity, includes session replay, feature flags), Mixpanel OSS setup (not open source itself, but alternative stacks exist), Plausible (simpler, privacy-first), and Fathom/Matomo (for less complex needs). For full Amplitude replacement: PostHog self-hosted covers 95% of Amplitude's features.

Key Takeaways

  • Amplitude pricing: Free to 50K MTUs, then $995+/month — steep scaling
  • PostHog: most complete alternative — funnels, retention, session replay, feature flags
  • Matomo: battle-tested, GDPR-friendly, robust event tracking
  • Plausible: simpler (page-level analytics) — not a full Amplitude replacement
  • OpenReplay: session replay specialist (complements PostHog or Matomo)
  • ClickHouse + Grafana: DIY stack for maximum performance at scale

What Amplitude Provides

  • Event tracking (button clicks, page views, custom events)
  • Funnel analysis (conversion flows)
  • Retention analysis (cohort tracking)
  • User paths (behavioral flows)
  • Segmentation (define user cohorts)
  • Session replay (watch user sessions)
  • A/B testing integration
  • Real-time dashboards

The most valuable features: funnels, retention, and session replay. These drive product decisions. The OSS alternatives cover all three.


The Alternatives

1. PostHog — The Most Complete Alternative

Best for: Teams that want everything Amplitude does in one self-hosted platform.

PostHog is purpose-built to replace commercial analytics. It's comprehensive: event tracking, funnels, retention, session replay, feature flags, A/B testing, surveys — all in one.

# Self-host PostHog with Docker Compose:
git clone https://github.com/PostHog/posthog
cd posthog/docker/
docker compose up -d

# Or the simplified version:
docker run -d \
  -p 8000:8000 \
  posthog/posthog:latest

# Access at http://localhost:8000
# Create admin account → get project API key

Integrate with your product:

// React/Next.js:
import posthog from 'posthog-js';

posthog.init('your-project-api-key', {
  api_host: 'https://your-posthog.company.com',
  capture_pageview: true,
  capture_pageleave: true,
  session_recording: { recordCanvas: true },
});

// Track events:
posthog.capture('subscription_upgraded', {
  plan: 'pro',
  mrr_delta: 49,
  user_id: user.id,
});

// Identify users:
posthog.identify(user.id, {
  email: user.email,
  name: user.name,
  plan: user.plan,
  created_at: user.createdAt,
});

// Feature flags:
if (posthog.isFeatureEnabled('new-checkout-flow')) {
  // Show new UI
}

PostHog vs Amplitude:

FeaturePostHogAmplitude
Funnels
Retention
Session Replay✅ (included)❌ (paid addon)
Feature Flags
A/B Testing
User Paths
SQL Access
Self-hosted

PostHog's session replay is particularly notable — Amplitude charges extra for it, PostHog includes it.

Self-hosting requirements:

  • Minimum: 4 vCPU, 8GB RAM (ClickHouse under the hood)
  • Recommended for production: 8 vCPU, 16GB RAM
  • Cost: ~$30-80/month on Hetzner or Hetzner Cloud
  • Free tier: 1M events/month on PostHog Cloud (beyond that, self-host)

GitHub: PostHog/posthog — 22K+ stars


2. Matomo — Battle-Tested with Full Event Tracking

Best for: Teams with GDPR compliance requirements, or replacing both Google Analytics and Amplitude.

Matomo has been around since 2007 (as Piwik). It's the most mature self-hosted analytics platform with full event tracking, goals, funnels, and cohorts.

# Docker:
docker run -d \
  --name matomo \
  -p 8080:80 \
  -v matomo:/var/www/html \
  matomo

# Or: download and run on PHP/MySQL server
# Full guide: https://matomo.org/docs/installation/

Event tracking in Matomo:

// Matomo tracking code:
var _paq = window._paq = window._paq || [];
_paq.push(['setTrackerUrl', 'https://your-matomo.com/matomo.php']);
_paq.push(['setSiteId', '1']);

// Track custom events:
_paq.push(['trackEvent', 'Checkout', 'Click', 'Start Checkout', 1]);
_paq.push(['trackEvent', 'Subscription', 'Upgraded', 'pro', 49]);

// Track goals (conversions):
_paq.push(['trackGoal', 1]); // Goal ID 1 = signup complete

Matomo strengths for Amplitude replacement:

  • Behavioral analytics: event tracking, custom dimensions
  • Funnel reports: conversion path analysis
  • Cohort analysis: user retention tracking
  • E-commerce analytics: detailed purchase tracking
  • GDPR-compliant by design (no cross-site tracking)
  • Import Google Analytics data (for migration)

Where Matomo falls short vs Amplitude:

  • No session replay (need to add OpenReplay separately)
  • Less polished user paths visualization
  • Slower to build custom dashboards

GitHub: matomo-org/matomo — 20K+ stars


3. OpenReplay — Session Replay Specialist

Best for: Adding session replay to any analytics setup.

OpenReplay is purpose-built for session replay. If you use Matomo or Plausible for event analytics, add OpenReplay for the "watch how users behave" layer that Amplitude charges for.

# Self-host:
git clone https://github.com/openreplay/openreplay
cd openreplay/scripts/helm
./install.sh

# Or Docker:
docker run -d \
  -p 9001:9001 \
  openreplay/openreplay-ee:latest
// Add to your app:
import OpenReplay from '@openreplay/tracker';
const tracker = new OpenReplay({
  projectKey: 'your-key',
  ingestPoint: 'https://your-openreplay.com/ingest',
});
tracker.start();

// Tag sessions for search:
tracker.setUserID(user.id);
tracker.setMetadata('plan', user.plan);

OpenReplay features:

  • Full session recording with DOM snapshots
  • Click maps and rage click detection
  • Error tracking (JS errors visible in replays)
  • Network request capture
  • Console log capture
  • Co-browse (share session with support team)
  • GDPR: mask sensitive fields automatically

GitHub: openreplay/openreplay — 9K+ stars


4. ClickHouse + Grafana (DIY for Scale)

Best for: Teams at serious scale (100M+ events/month) or with existing data engineering capacity.

Amplitude runs on ClickHouse internally. Build your own:

# ClickHouse for event storage:
docker run -d \
  --name clickhouse \
  -p 8123:8123 \
  -p 9000:9000 \
  -v clickhouse_data:/var/lib/clickhouse \
  clickhouse/clickhouse-server

# Schema for product events:
CREATE TABLE events (
  timestamp   DateTime64(3),
  event_name  LowCardinality(String),
  user_id     String,
  session_id  String,
  properties  Map(String, String),
  date        Date MATERIALIZED toDate(timestamp)
) ENGINE = MergeTree()
ORDER BY (date, event_name, user_id);

# Ingest via API or Kafka
# Visualize with Grafana + ClickHouse plugin

This approach requires data engineering but gives you:

  • Unlimited events (storage cost ~$0.02/GB)
  • Sub-second query performance on billions of rows
  • Full SQL access for custom analysis
  • No per-user pricing

Cost at scale:

  • 100M events/month → ~50GB → $1/month storage
  • vs Amplitude: $2,000+/month at that scale

Early-stage (< 50K MAU):
→ PostHog Cloud free tier
→ Upgrade to self-hosted when you hit 1M events/month

Growth-stage (50K-500K MAU):
→ PostHog self-hosted ($30-80/month VPS)
→ Add OpenReplay for session replay if PostHog's replay isn't enough

Scale-stage (500K+ MAU):
→ PostHog self-hosted on dedicated ClickHouse cluster
→ Or custom ClickHouse + Grafana if you have data engineers

Privacy-first (any size):
→ Matomo self-hosted + OpenReplay
→ Plausible for simple page analytics
→ Zero data leaves your servers

Migration: Amplitude → PostHog

# 1. Install PostHog SDK alongside Amplitude:
npm install posthog-js

# 2. Run both in parallel for 2-4 weeks to validate data:
// posthog.init(...)
// amplitude.init(...)
posthog.capture(event, properties); // Mirror all events
amplitude.track(event, properties); // During validation

# 3. Export Amplitude data (30-day free export):
# Amplitude → Settings → Data Governance → Export

# 4. Import to PostHog (via API):
curl -X POST https://your-posthog.com/batch/ \
  -H "Content-Type: application/json" \
  -d '{"api_key": "your-key", "batch": [...]}'

# 5. Remove Amplitude after validation

Explore more open source alternatives at OSSAlt.

Comments