Self-Hosting Guide

Self-host Open Analytics on your own infrastructure

Deploy on Docker, Linux, or Kubernetes. Total data sovereignty, MongoDB persistence, automated TTL purging, and zero third-party vendor lock-in.

The Challenge

Why privacy-conscious teams self-host analytics

Sending visitor telemetry to US-hosted cloud providers creates legal uncertainty under GDPR, NIS2, and strict data sovereignty frameworks. Self-hosting guarantees total custody of your telemetry data.

  • xThird-party analytics servers can expose user data during sub-processor data breaches
  • xCross-border telemetry transfers risk violating EU Schrems II and regional data privacy laws
  • xCloud analytics quotas impose steep billing spikes as your web traffic scales
  • xAir-gapped enterprise networks and internal portals cannot send telemetry to external cloud endpoints
What Open Analytics Delivers

Simple, reliable, low-maintenance deployment

Open Analytics requires only Node.js and MongoDB to run. It deploys cleanly as a standard container or service with zero external dependencies.

Single MongoDB Requirement
No complex multi-database stacks or message queues required. Operates with standard MongoDB 6.0+ instances.
Automated Data Retention
Built-in 365-day TTL indexes and purge scripts automatically prevent databases from unbounded disk growth.
Environment Variable Config
Configure ports, database URIs, JWT secrets, and allowed origins entirely through clean standard environment variables.
Technical Mechanics

Self-hosted infrastructure topology

Standard three-tier architecture: edge reverse proxy, Next.js application server, and MongoDB cluster.

01. Database Setup

MongoDB Cluster Configuration

Provision a local MongoDB container or managed MongoDB Atlas cluster with replica sets for real-time change streams.

02. Environment Setup

.env.local Configuration

Set MONGODB_URI, JWT_SECRET, and your public domain origins (NEXT_PUBLIC_APP_URL and NEXT_PUBLIC_API_URL).

03. Reverse Proxy & Edge

Nginx / Cloudflare Configuration

Route apex traffic to the Next.js app and serve `/open.js` with public CORS and HTTP caching headers.

Production Use Cases

How engineering and growth teams rely on Open Analytics in production.

Healthcare & FinTech Compliance

Keep telemetry in on-premise HIPAA and SOC2-certified private cloud environments without external network egress.

Internal Corporate Intranets

Track employee portal usage, internal documentation, and private SaaS dashboards with total isolation.

Ultra-High Traffic Portals

Ingest tens of millions of monthly events on dedicated servers without paying thousands in cloud vendor overage fees.

Captured Signals & Benchmarks

Precision telemetry captured with zero browser performance overhead.

SignalUnitBenchmarkDescription
Minimum CPUCores1 vCPUSufficient to ingest up to 2 million monthly pageviews comfortably.
Minimum RAMMemory1 GB RAMLightweight runtime footprint with low baseline memory consumption.
Database EngineVersionMongoDB 6.0+Standard document database with support for secondary indices and TTL expiration.
Network OverheadTransfer< 3.2 KB / hitFeatherweight Brotli compressed payload sent over HTTP/2 or HTTP/3.
Privacy Safeguards

Privacy by Design & GDPR Exemption

Open Analytics processes telemetry without invasive user surveillance.

  • 100% of telemetry data remains inside your own private database network
  • Zero analytics pings, beacons, or telemetry phone-home calls to external servers
  • Ephemeral daily salts rotate locally without external key management dependencies
  • Completely compliant with GDPR, Swiss FADP, CCPA, and enterprise security policies
Environment Configuration (.env.local)
# Database & Auth
MONGODB_URI=mongodb://localhost:27017/open_analytics
JWT_SECRET=your_32_character_random_secret_string

# Domain Origins
NEXT_PUBLIC_APP_URL=https://analytics.yourcompany.com
NEXT_PUBLIC_API_URL=https://analytics.yourcompany.com

# Port
PORT=3005

Async non-blocking beacon weighing <3.2 KB Brotli compressed.

Questions & Answers

Frequently Asked Questions

Start capturing precision telemetry in 60 seconds

Deploy on your own infrastructure or launch on Open Analytics Cloud. Zero cookies required.