docker.recipes

Fathom Lite Analytics

beginner

Simple, privacy-first website analytics (open-source lite version).

Overview

Fathom Lite Analytics is a privacy-first, open-source web analytics platform developed as a lightweight alternative to Google Analytics. Originally created by Paul Jarvis and Jack Ellis, Fathom focuses on providing essential website metrics without compromising visitor privacy or requiring cookie consent banners. The platform collects anonymous traffic data while being fully GDPR, CCPA, and PECR compliant by design. This Docker stack deploys Fathom using SQLite as the database backend, creating a self-contained analytics solution that stores all data locally on your infrastructure. The configuration uses persistent volumes for data retention and exposes the web interface on port 8080, making it accessible for both small personal websites and larger organizational deployments. This setup is ideal for developers, small businesses, and privacy-conscious organizations who want complete control over their analytics data without relying on third-party services that track users across the web.

Key Features

  • Privacy-first analytics with no personal data collection or IP address storage
  • SQLite database backend requiring no external database dependencies
  • Lightweight tracking script under 2KB that loads quickly on websites
  • Real-time visitor tracking and pageview statistics
  • GDPR compliant analytics without requiring cookie consent banners
  • Clean, minimalist dashboard showing essential metrics only
  • Self-hosted solution keeping all analytics data under your control
  • Anonymous visitor counting with basic geographic insights

Common Use Cases

  • 1Small business websites needing basic traffic insights without privacy concerns
  • 2Personal blogs and portfolio sites requiring lightweight analytics
  • 3EU-based organizations needing GDPR-compliant analytics solutions
  • 4Development agencies managing multiple client websites with privacy requirements
  • 5Educational institutions tracking course material and resource usage
  • 6Non-profit organizations monitoring campaign effectiveness while respecting donor privacy
  • 7Tech startups replacing Google Analytics for improved user trust

Prerequisites

  • Docker and Docker Compose installed on the host system
  • Minimum 512MB RAM available for the Fathom container
  • Port 8080 available and not conflicting with other services
  • Basic understanding of web analytics and tracking code implementation
  • Access to website source code for adding Fathom tracking script
  • Generated secret key for FATHOM_SECRET environment variable

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 fathom:
3 image: usefathom/fathom:latest
4 container_name: fathom
5 environment:
6 - FATHOM_SERVER_ADDR=:8080
7 - FATHOM_DATABASE_DRIVER=sqlite3
8 - FATHOM_DATABASE_NAME=/data/fathom.db
9 - FATHOM_SECRET=${FATHOM_SECRET}
10 volumes:
11 - fathom-data:/data
12 ports:
13 - "8080:8080"
14 networks:
15 - fathom-network
16 restart: unless-stopped
17
18volumes:
19 fathom-data:
20
21networks:
22 fathom-network:
23 driver: bridge

.env Template

.env
1# Fathom Lite
2# Generate with: openssl rand -hex 32
3FATHOM_SECRET=your_secret_key
4
5# Create user: fathom user add --email=you@example.com --password=yourpassword

Usage Notes

  1. 1Dashboard at http://localhost:8080
  2. 2Create user via CLI first
  3. 3Simple tracking script
  4. 4Privacy-focused by design
  5. 5Note: Lite version is limited

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 fathom:
5 image: usefathom/fathom:latest
6 container_name: fathom
7 environment:
8 - FATHOM_SERVER_ADDR=:8080
9 - FATHOM_DATABASE_DRIVER=sqlite3
10 - FATHOM_DATABASE_NAME=/data/fathom.db
11 - FATHOM_SECRET=${FATHOM_SECRET}
12 volumes:
13 - fathom-data:/data
14 ports:
15 - "8080:8080"
16 networks:
17 - fathom-network
18 restart: unless-stopped
19
20volumes:
21 fathom-data:
22
23networks:
24 fathom-network:
25 driver: bridge
26EOF
27
28# 2. Create the .env file
29cat > .env << 'EOF'
30# Fathom Lite
31# Generate with: openssl rand -hex 32
32FATHOM_SECRET=your_secret_key
33
34# Create user: fathom user add --email=you@example.com --password=yourpassword
35EOF
36
37# 3. Start the services
38docker compose up -d
39
40# 4. View logs
41docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/fathom-analytics/run | bash

Troubleshooting

  • Dashboard shows 'Database locked' error: Stop the container, check file permissions on the volume mount, and ensure only one Fathom instance accesses the SQLite database
  • Cannot create admin user account: Use docker exec to run 'fathom user add' command inside the running container with appropriate email and password parameters
  • Tracking script not recording pageviews: Verify the site ID matches between dashboard and tracking code, and check browser console for JavaScript errors
  • Container fails to start with permission errors: Ensure the Docker daemon has write access to the volume mount point and the fathom user can access /data directory
  • Dashboard accessible but shows no data: Confirm tracking script is properly installed on website pages and test with browser developer tools network tab
  • High memory usage with large datasets: Consider migrating from SQLite to PostgreSQL for better performance with high-traffic websites

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space