Fathom Lite is a self-hosted, open-source alternative to Google Analytics that delivers real-time website analytics with a focus on privacy and simplicity. Designed for developers and privacy-conscious website owners, it eliminates third-party tracking, cookie banners, and data collection by big tech firms. It’s ideal for those who want full control over their analytics data without relying on cloud-hosted services.
Built with Golang for the backend and Preact for the frontend, Fathom Lite runs on a single binary and can be deployed via Docker or directly on Linux servers. It stores data locally, requires no external dependencies beyond a PostgreSQL database, and integrates via a simple JavaScript snippet. While no longer under active feature development, it remains maintained for security and bug fixes.
What You Get
- Self-hosted analytics - Run Fathom on your own server or Docker container with full control over data storage and access, no third-party cloud dependency.
- Cookie-free tracking - Collects web traffic data without using cookies, eliminating the need for cookie consent banners and improving compliance with GDPR and CCPA.
- Real-time dashboard - View live visitor counts, page views, referrers, and traffic sources in a clean, minimal interface with no complex reporting layers.
- Bot and spam filtering - Automatically blocks bots, scrapers, and non-human traffic to ensure metrics reflect only genuine human visits.
- Single-line tracking snippet - Integrate analytics with one line of JavaScript code compatible with any website, CMS, or framework without complex setup.
- PostgreSQL data storage - Uses PostgreSQL as the backend database for reliable, scalable storage of analytics data with full SQL access for queries.
Common Use Cases
- Running a privacy-focused blog - A writer uses Fathom Lite to track visitors without collecting personal data or displaying cookie banners, ensuring GDPR compliance while maintaining simple traffic insights.
- Hosting analytics for client websites - A web agency deploys Fathom Lite on their own server to offer clients transparent, no-tracking analytics as part of their service package.
- Internal tool usage monitoring - A SaaS company tracks how users interact with their internal admin dashboard using Fathom Lite to avoid exposing data to Google Analytics.
- Educational or nonprofit websites - Universities or NGOs use Fathom Lite to comply with strict data protection policies while still understanding site traffic patterns.
Under The Hood
Architecture
- Monolithic structure with main.go as the sole entry point, tightly coupling CLI logic with application core
- No dependency injection or service container; configuration flows directly into global state, violating inversion of control
- Frontend assets embedded via Packr2 and GoBindata, creating opaque, hard-to-debug dependencies between UI and backend
- Absence of layered architecture or domain-driven design, with data access, business logic, and HTTP handlers interwoven
- Build system driven by hardcoded Makefile commands, lacking declarative configuration and environmental reproducibility
Tech Stack
- Go backend using standard library HTTP server with embedded assets, compiled via static linking
- Legacy frontend stack with Preact 8, D3.js 5, and Deko, bundled using Browserify and Gulp 4
- MySQL 5 as the sole data store, with migrations managed through Go code and environment variables
- Docker-based multi-stage builds combining Node.js, Go, and Alpine for streamlined deployment
- CI/CD orchestrated via Goreleaser and Makefile, automating cross-platform binary generation
- Tooling includes Golint, Errcheck, and Go vet for basic code quality checks
Code Quality
- Minimal test coverage with no structured assertions or behavioral validation
- Error handling is superficial, relying on generic catches without contextual logging or custom error types
- Code organization lacks modular boundaries, with functions and components mixed without clear layering
- Inconsistent naming conventions across the codebase, mixing camelCase and snake_case
- No type safety enforcement or static analysis tools beyond basic linters
- Absence of formal code style enforcement, leading to inconsistent formatting and readability issues
What Makes It Unique
- Real-time, client-side data aggregation with dynamic date bucketing in D3.js, eliminating server-side preprocessing
- Self-contained, zero-dependency analytics suite with bundled charting, date pickers, and UI components
- Hash-based URL state management enabling deep-linked, bookmarkable analytics views without server routing
- Custom SVG gearwheel UI component providing subtle visual feedback for settings state
- Single-binary deployment model with embedded assets, removing containerization overhead while preserving portability