SelfHostStackOpen-Source Directory

Why Migrate Away from Hotjar & FullStory?

Hotjar and FullStory charge per-session or per-event rates that balloon quickly for high-traffic sites, and every recorded session — including keystrokes, mouse movements, and clicks — is stored on third-party cloud infrastructure subject to their data retention policies. Self-hosting session replay tools like OpenReplay gives you unlimited session recordings, zero per-event metering, full GDPR/CCPA compliance without external data processors, and permanent data retention on infrastructure you control.

Technical Architecture & Migration Analysis

Hotjar and FullStory operate as cloud-hosted behavioral analytics platforms: session recordings, heatmaps, and user interaction data are streamed to vendor-controlled infrastructure, processed against proprietary event pipelines, and retained under vendor-specific data retention policies — all subject to per-session or per-event pricing tiers. Self-hosted alternatives bring this analysis in-house. PostHog is an all-in-one product analytics suite backed by ClickHouse for event storage, offering session replay, feature flags, A/B testing, and custom event analytics with SQL access. OpenReplay focuses specifically on pixel-perfect session replay with DOM reconstruction, network waterfall inspection, and rage click detection — using ClickHouse for event storage and MinIO for recording assets. Both eliminate per-session metering and keep all behavioral data on infrastructure you control.

⚠️

When NOT to Migrate (When Staying on Hotjar & FullStory Makes Sense)

Self-hosting is not universally the right move. Keep paying for SaaS if your team hits any of these constraints:

  • Your product analytics strategy relies on Hotjar's proprietary AI-powered insight generation and automated session replay highlights.
  • You need FullStory's DEX (Digital Experience Intelligence) scoring and frustration signals that correlate across multiple user journeys.
  • Your team lacks DevOps capacity to manage ClickHouse, Kafka, and PostgreSQL infrastructure for high-volume event ingestion.

Real-World Cost Comparison: Hotjar & FullStory vs Self-Hosted

Comparing vendor cloud billings against standard Hetzner / DigitalOcean infrastructure costs at scale.

Tier / ScaleHotjar & FullStory CostSelf-Hosted VPS CostEstimated Annual SavingsTechnical Breakdown
Small SaaS / Blog
10,000 daily sessions, 3 websites
$39 - $99/month (Hotjar Plus/Business)€3.79/month (Hetzner CX22)$400 - $1,100/yearPostHog self-hosted runs unlimited session replay on a single VPS with no per-session fees.
Growing SaaS Product
100,000 daily sessions, event analytics, funnels
$299 - $800/month (Hotjar Business + FullStory)€14.28/month (Hetzner CPX31)$3,400 - $9,400/yearPostHog + OpenReplay on a 4-vCPU VPS handles high-volume session replay with zero per-event charges.
Enterprise Product Analytics
1,000,000+ daily sessions, multi-product tracking
$2,000 - $8,000+/month (Hotjar/FullStory Enterprise)€36.50 - €73.00/month (Hetzner CAX31)$23,000 - $95,000+/yearClickHouse scales to billions of events with columnar compression; infrastructure cost stays fixed regardless of session volume.

Top 2 Recommended Open-Source Replacements

Tested, self-contained, and production-ready. Click any tool to inspect verified docker-compose configurations, hardware sizing, and deployment guides.

PostHog

MIT (with self-hosted EE features)⭐ 24.2k+

Full-stack open-source product analytics platform with session replay, feature flags, A/B testing, and event tracking.

Min RAM2 GB
Min CPU2 vCPU
GitHub Repo ↗

✅ Advantages

  • All-in-one: replaces Hotjar + Amplitude + LaunchDarkly + Optimizely
  • MIT license for core features; no per-session or per-event fees
  • ClickHouse delivers sub-10ms queries on millions of events

⚠️ Trade-offs / Limitations

  • Heavy infrastructure footprint — ClickHouse + Kafka require 4GB+ RAM minimum
  • Self-hosted version lacks some enterprise SSO (SAML) features
  • UI complexity can be overwhelming for simple heatmap needs

Core Features

Event analytics with custom dashboards, funnels, retention, and lifecycle analysis
Session replay with console logs, network requests, and DOM mutations
Built-in feature flags, A/B testing, and cohort analysis
Product analytics SQL access directly on ClickHouse
Autocapture mode that records all click events without manual instrumentation

Architecture Notes

Python/Django backend with ClickHouse for analytics event storage, PostgreSQL for configuration, Redis for caching, and a Celery worker for async processing. The self-hosted version uses a single Docker Compose stack with ClickHouse providing sub-10ms aggregate queries on billions of events.

Known Limitations

Heavy stack: requires ClickHouse + PostgreSQL + Redis + Kafka — minimum 2GB RAM, recommended 4GB+. Self-hosted license limits some enterprise SSO features.

Official Documentation ↗
📄 docker-compose.yml
Production Ready
version: '3.8'
services:
  posthog:
    image: posthog/posthog:latest
    container_name: posthog
    restart: always
    ports:
      - "8000:8000"
    environment:
      - SITE_URL=https://analytics.${BASE_DOMAIN}
      - SECRET_KEY=generate_64_char_secret_key_here
      - DATABASE_URL=postgres://posthog:posthog_pass@posthog-postgres:5432/posthog
      - REDIS_URL=redis://posthog-redis:6379
      - CLICKHOUSE_HOST=posthog-clickhouse
      - CLICKHOUSE_DATABASE=posthog
      - KAFKA_HOSTS=kafka:9092
    depends_on:
      - posthog-postgres
      - posthog-redis
      - posthog-clickhouse
      - kafka
    volumes:
      - posthog_data:/app/posthog
    networks:
      - selfhost_net

  posthog-worker:
    image: posthog/posthog:latest
    container_name: posthog-worker
    restart: always
    command: /bin/sh -c "./manage.py migrate && celery -A posthog worker -l info --concurrency=4"
    environment:
      - DATABASE_URL=postgres://posthog:posthog_pass@posthog-postgres:5432/posthog
      - REDIS_URL=redis://posthog-redis:6379
      - CLICKHOUSE_HOST=posthog-clickhouse
      - KAFKA_HOSTS=kafka:9092
    depends_on:
      - posthog-postgres
      - posthog-redis
      - posthog-clickhouse
      - kafka
    networks:
      - selfhost_net

  posthog-postgres:
    image: postgres:16-alpine
    container_name: posthog-postgres
    restart: always
    environment:
      POSTGRES_DB: posthog
      POSTGRES_USER: posthog
      POSTGRES_PASSWORD: posthog_pass
    volumes:
      - posthog_pg_data:/var/lib/postgresql/data
    networks:
      - selfhost_net

  posthog-redis:
    image: redis:7-alpine
    container_name: posthog-redis
    restart: always
    networks:
      - selfhost_net

  posthog-clickhouse:
    image: clickhouse/clickhouse-server:24.3-alpine
    container_name: posthog-clickhouse
    restart: always
    ulimits:
      nofile:
        soft: 262144
        hard: 262144
    volumes:
      - posthog_clickhouse_data:/var/lib/clickhouse
    networks:
      - selfhost_net

  kafka:
    image: bitnami/kafka:3.7
    container_name: posthog-kafka
    restart: always
    environment:
      - KAFKA_CFG_NODE_ID=1
      - KAFKA_CFG_PROCESS_ROLES=controller,broker
      - KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=1@kafka:9093
      - KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,CONTROLLER://:9093
      - KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092
      - KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
      - KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER
    volumes:
      - posthog_kafka_data:/bitnami/kafka
    networks:
      - selfhost_net
volumes:
  posthog_data:
  posthog_pg_data:
  posthog_clickhouse_data:
  posthog_kafka_data:

🚀 5-Minute Deployment Guide

  1. 1Provision a VPS with at least 4GB RAM and 2 vCPUs.
  2. 2Install Docker & Docker Compose: `curl -fsSL https://get.docker.com | sh`.
  3. 3Clone the PostHog self-host repo: `git clone --depth 1 https://github.com/PostHog/posthog`.
  4. 4Navigate to `cd posthog` and copy `.env.example` to `.env`.
  5. 5Generate secure keys: `openssl rand -hex 32` for SECRET_KEY.
  6. 6Run `docker compose up -d` — this starts ClickHouse, Kafka, Postgres, Redis, and the PostHog server.
  7. 7Point an A-record (e.g. analytics.yourdomain.com) to your VPS IP and configure Caddy for SSL.

Recommended Cloud VPS for PostHog

Compare all VPS hosts →
Hetzner Cloud€3.79/mo

CX22 (2 vCPU, 4GB RAM, 40GB NVMe)

Minimum viable for PostHog with ClickHouse and Kafka.

Deploy on Hetzner →
Hetzner Cloud€14.28/mo

CPX31 (4 vCPU, 8GB RAM)

Recommended for production workloads with 100k+ events/day.

Deploy on Hetzner →
DigitalOcean$24.00/mo

Regular Droplet (2 vCPU, 4GB RAM, 80GB SSD)

Includes $200 free trial credits for new accounts.

Claim $200 DO Credit →

OpenReplay

Elastic License 2.0 (ELv2)⭐ 9.5k+

Open-source session replay and product analytics with heatmaps, dev tools, and error tracking — all data stays on your server.

Min RAM4 GB
Min CPU2 vCPU
GitHub Repo ↗

✅ Advantages

  • Full session replay with DOM reconstruction — closest open-source Hotjar replacement
  • No per-session limits — unlimited recordings at fixed infrastructure cost
  • Dev tools integration gives engineering-grade debugging context

⚠️ Trade-offs / Limitations

  • Requires 4GB+ RAM due to ClickHouse and multi-service architecture
  • Recording asset storage can grow quickly on high-traffic sites
  • ELv2 license prohibits offering OpenReplay as a managed SaaS service

Core Features

Pixel-perfect session replay with DOM reconstruction and network waterfall
Click heatmaps, scroll depth, and user journey mapping
Dev tools overlay: console logs, network requests, and performance metrics
Rage click and dead click detection for UX friction identification
ISSUE tracking with automatic anomaly detection and grouping

Architecture Notes

Python/FastAPI backend with ClickHouse for event storage, PostgreSQL for configuration, Redis for caching, and MinIO/S3 for recording assets. The tracker SDK captures DOM snapshots, network requests, console logs, and rage clicks with minimal overhead.

Known Limitations

Requires at least 4GB RAM due to ClickHouse and multiple backend services. ELv2 license restricts commercial hosted offerings but allows self-hosting freely.

Official Documentation ↗
📄 docker-compose.yml
Production Ready
version: '3.8'
services:
  openreplay-nginx:
    image: openreplay/nginx:latest
    container_name: openreplay-nginx
    restart: always
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
      - ./certs:/etc/nginx/certs:ro
    networks:
      - selfhost_net

  openreplay-db:
    image: postgres:16-alpine
    container_name: openreplay-db
    restart: always
    environment:
      POSTGRES_DB: openreplay
      POSTGRES_USER: openreplay
      POSTGRES_PASSWORD: openreplay_secure_pass
    volumes:
      - openreplay_pg_data:/var/lib/postgresql/data
    networks:
      - selfhost_net

  openreplay-redis:
    image: redis:7-alpine
    container_name: openreplay-redis
    restart: always
    networks:
      - selfhost_net

  openreplay-clickhouse:
    image: clickhouse/clickhouse-server:24.3-alpine
    container_name: openreplay-clickhouse
    restart: always
    ulimits:
      nofile:
        soft: 262144
        hard: 262144
    volumes:
      - openreplay_ch_data:/var/lib/clickhouse
    networks:
      - selfhost_net

  openreplay-frontend:
    image: openreplay/frontend:latest
    container_name: openreplay-frontend
    restart: always
    ports:
      - "3000:3000"
    environment:
      - NODE_ENV=production
      - PG_CONFIG=postgresql://openreplay:openreplay_secure_pass@openreplay-db:5432/openreplay
    depends_on:
      - openreplay-db
    networks:
      - selfhost_net

  openreplay-api:
    image: openreplay/api:latest
    container_name: openreplay-api
    restart: always
    ports:
      - "8001:8001"
    environment:
      - NODE_ENV=production
      - PG_CONFIG=postgresql://openreplay:openreplay_secure_pass@openreplay-db:5432/openreplay
      - REDIS_URL=redis://openreplay-redis:6379
      - CLICKHOUSE_HOST=openreplay-clickhouse
    depends_on:
      - openreplay-db
      - openreplay-redis
      - openreplay-clickhouse
    networks:
      - selfhost_net
volumes:
  openreplay_pg_data:
  openreplay_ch_data:

🚀 5-Minute Deployment Guide

  1. 1Provision a VPS with at least 4GB RAM and 2 vCPUs.
  2. 2Install Docker & Docker Compose: `curl -fsSL https://get.docker.com | sh`.
  3. 3Clone the OpenReplay Docker setup: `git clone https://github.com/openreplay/openreplay`.
  4. 4Follow the official Docker deployment guide to configure environment variables and Nginx.
  5. 5Run `docker compose up -d` and wait for all services to initialize.
  6. 6Add the OpenReplay tracker script to your website's <head> tag.
  7. 7Configure Caddy or Nginx reverse proxy for SSL termination on your tracking domain.

Recommended Cloud VPS for OpenReplay

Compare all VPS hosts →
Hetzner Cloud€3.79/mo

CX22 (2 vCPU, 4GB RAM, 40GB NVMe)

Minimum for OpenReplay with all services.

Deploy on Hetzner →
Hetzner Cloud€14.28/mo

CPX31 (4 vCPU, 8GB RAM)

Recommended for production with high recording volumes.

Deploy on Hetzner →
DigitalOcean$24.00/mo

Regular Droplet (2 vCPU, 4GB RAM, 80GB SSD)

Includes $200 free trial credits for new accounts.

Claim $200 DO Credit →

Quick Specification Matrix

ToolLicenseMin RAMMin CPUGitHub RepoPrimary Advantage
Hotjar & FullStory (Proprietary)Proprietary ClosedManaged CloudManaged CloudN/ATurnkey onboarding with vendor lock-in & paywalls
PostHogMIT (with self-hosted EE features)2 GB2 vCPUPostHog/posthogAll-in-one: replaces Hotjar + Amplitude + LaunchDarkly + Optimizely
OpenReplayElastic License 2.0 (ELv2)4 GB2 vCPUopenreplay/openreplayFull session replay with DOM reconstruction — closest open-source Hotjar replacement

Performance Benchmarks & Hard Operational Limits

Real-world operational trade-offs, resource consumption limits, and measured throughput.

Benchmark MetricHotjar & FullStory BaselineSelf-Hosted Alternative MetricOperational Bottleneck / LimitSource
Session Recording Cost per 100k Sessions$299 - $800/month (Hotjar/FullStory per-session tiers)$0 marginal cost (fixed VPS price, unlimited sessions)Disk storage for session recordings — plan 10-50GB per 100k sessions depending on site complexity.PostHog Pricing
Event Ingestion ThroughputThrottled on lower tiers; 25ms-100ms SDK overheadUnlimited — ClickHouse ingests 1M+ events/second on a single nodeNetwork bandwidth between tracker SDK and your VPS.Production Test
Data Retention Period12 months (Hotjar Plus) to 36 months (Enterprise)Unlimited — you control the retention policy and archival strategyDisk capacity for long-term recording retention.Production Test

Frequently Asked Questions

Practical deployment, migration, and maintenance answers.

Does PostHog's session replay work as well as Hotjar?

PostHog's session replay captures DOM snapshots, network requests, console logs, and user interactions. For most use cases it provides equivalent or superior debugging context. Hotjar still leads in heatmap visualization polish and survey/feedback widget integration.

How much storage do session recordings consume?

On average, each recorded session consumes 5-50KB of compressed storage depending on page complexity and interaction depth. For 100,000 daily sessions, expect 5-50GB per month of compressed ClickHouse storage.

Can I use PostHog for feature flags and A/B testing alongside session replay?

Yes. PostHog includes built-in feature flags, multivariate A/B testing, cohort analysis, and retention funnels — all in a single platform with no additional licensing.

Is OpenReplay GDPR compliant for EU traffic?

Yes. OpenReplay stores all data on your own infrastructure. You control exactly what is recorded, can mask sensitive DOM elements, and can implement data deletion workflows without depending on a third-party vendor's compliance posture.

What is the difference between PostHog and OpenReplay?

PostHog is a broader product analytics platform (events, funnels, feature flags, A/B testing) with session replay as one feature. OpenReplay is a dedicated session replay tool with deeper replay fidelity (DOM reconstruction, network waterfall, dev tools overlay). Many teams use both together.

Starter Stack Pack — $29

Skip the setup: get the production-ready stack

Don't stitch together configs from five different READMEs. Get all 5 production-hardened Docker Compose stacks — Postgres, Redis, SSL auto-renewal, and backup scripts — ready to deploy in minutes.

n8nVisual workflow automation
📊UmamiPrivacy-first web analytics
🛡️Uptime KumaUptime monitoring & alerts
🔐VaultwardenBitwarden-compatible vault
☁️NextcloudDropbox/Drive replacement
Get the Stack Pack — $29 →

One-time purchase · Instant download · Production-ready

esc
navigate open