Open-Source & Self-Hosted Alternatives to Hotjar & FullStory
Cloud-hosted session replay, heatmaps, and behavioral analytics with per-session recording limits, GDPR cookie consent banners, and proprietary data retention walls.
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 / Scale | Hotjar & FullStory Cost | Self-Hosted VPS Cost | Estimated Annual Savings | Technical Breakdown |
|---|---|---|---|---|
Small SaaS / Blog 10,000 daily sessions, 3 websites | $39 - $99/month (Hotjar Plus/Business) | €3.79/month (Hetzner CX22) | $400 - $1,100/year | PostHog 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/year | PostHog + 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+/year | ClickHouse 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.
✅ 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
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
- 1Provision a VPS with at least 4GB RAM and 2 vCPUs.
- 2Install Docker & Docker Compose: `curl -fsSL https://get.docker.com | sh`.
- 3Clone the PostHog self-host repo: `git clone --depth 1 https://github.com/PostHog/posthog`.
- 4Navigate to `cd posthog` and copy `.env.example` to `.env`.
- 5Generate secure keys: `openssl rand -hex 32` for SECRET_KEY.
- 6Run `docker compose up -d` — this starts ClickHouse, Kafka, Postgres, Redis, and the PostHog server.
- 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 →CX22 (2 vCPU, 4GB RAM, 40GB NVMe)
Minimum viable for PostHog with ClickHouse and Kafka.
Deploy on Hetzner →CPX31 (4 vCPU, 8GB RAM)
Recommended for production workloads with 100k+ events/day.
Deploy on Hetzner →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.
✅ 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
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
- 1Provision a VPS with at least 4GB RAM and 2 vCPUs.
- 2Install Docker & Docker Compose: `curl -fsSL https://get.docker.com | sh`.
- 3Clone the OpenReplay Docker setup: `git clone https://github.com/openreplay/openreplay`.
- 4Follow the official Docker deployment guide to configure environment variables and Nginx.
- 5Run `docker compose up -d` and wait for all services to initialize.
- 6Add the OpenReplay tracker script to your website's <head> tag.
- 7Configure Caddy or Nginx reverse proxy for SSL termination on your tracking domain.
Recommended Cloud VPS for OpenReplay
Compare all VPS hosts →CX22 (2 vCPU, 4GB RAM, 40GB NVMe)
Minimum for OpenReplay with all services.
Deploy on Hetzner →CPX31 (4 vCPU, 8GB RAM)
Recommended for production with high recording volumes.
Deploy on Hetzner →Regular Droplet (2 vCPU, 4GB RAM, 80GB SSD)
Includes $200 free trial credits for new accounts.
Claim $200 DO Credit →Quick Specification Matrix
| Tool | License | Min RAM | Min CPU | GitHub Repo | Primary Advantage |
|---|---|---|---|---|---|
| Hotjar & FullStory (Proprietary) | Proprietary Closed | Managed Cloud | Managed Cloud | N/A | Turnkey onboarding with vendor lock-in & paywalls |
| PostHog | MIT (with self-hosted EE features) | 2 GB | 2 vCPU | PostHog/posthog | All-in-one: replaces Hotjar + Amplitude + LaunchDarkly + Optimizely |
| OpenReplay | Elastic License 2.0 (ELv2) | 4 GB | 2 vCPU | openreplay/openreplay | Full 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 Metric | Hotjar & FullStory Baseline | Self-Hosted Alternative Metric | Operational Bottleneck / Limit | Source |
|---|---|---|---|---|
| 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 Throughput | Throttled on lower tiers; 25ms-100ms SDK overhead | Unlimited — ClickHouse ingests 1M+ events/second on a single node | Network bandwidth between tracker SDK and your VPS. | Production Test |
| Data Retention Period | 12 months (Hotjar Plus) to 36 months (Enterprise) | Unlimited — you control the retention policy and archival strategy | Disk 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.
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.
One-time purchase · Instant download · Production-ready