# Ackee Analytics

> Self-hosted, privacy-focused web analytics alternative.

- Category: Monitoring & Observability
- Difficulty: beginner
- Components: ackee, mongodb
- Tags: analytics, ackee, privacy, web-analytics, minimal
- Source: https://docker.recipes/monitoring/ackee-analytics

## Overview

Ackee is a self-hosted, privacy-first web analytics platform created by Tobias Reich as a lightweight alternative to Google Analytics. Built with Node.js, Ackee focuses on collecting essential website metrics without compromising user privacy - it doesn't use cookies, fingerprinting, or personal data collection, making it GDPR compliant by design. The platform provides clean, minimalist dashboards showing visitor counts, page views, referrers, and device information while respecting user anonymity. This stack combines Ackee with MongoDB to create a complete analytics solution where Ackee handles the web interface and data collection while MongoDB stores all analytics data in its flexible document format. MongoDB's schema-less design perfectly accommodates Ackee's varied analytics data structures, from simple page views to complex visitor patterns, while its aggregation framework enables efficient real-time analytics queries. This combination is ideal for privacy-conscious website owners, small businesses, bloggers, and organizations that need website insights without sacrificing user privacy or depending on third-party analytics services that may track users across sites.

## Features

- Cookie-free tracking with automatic visitor anonymization and IP address hashing
- Real-time analytics dashboard showing live visitor counts and page views
- Detailed referrer tracking including social media, search engines, and direct traffic sources
- Device and browser statistics without fingerprinting or personal identification
- Multi-domain support allowing analytics for multiple websites from single dashboard
- MongoDB aggregation pipeline integration for complex analytics queries and custom reports
- Lightweight JavaScript tracking script with minimal impact on website performance
- REST API access for programmatic data retrieval and custom integrations

## Use cases

- Privacy-focused websites requiring GDPR compliance without cookie consent banners
- Small business websites needing basic traffic analytics without Google Analytics dependency
- Personal blogs and portfolios tracking visitor engagement and popular content
- Educational institutions monitoring website usage while protecting student privacy
- Non-profit organizations analyzing web traffic without compromising donor privacy
- Development agencies offering privacy-compliant analytics to privacy-conscious clients
- Corporate intranets tracking internal resource usage without employee monitoring concerns

## Prerequisites

- Docker and Docker Compose installed on host system
- Minimum 1GB RAM available (512MB for MongoDB, 256MB for Ackee, plus system overhead)
- Port 3000 available for Ackee web interface access
- Environment variables ACKEE_USERNAME and ACKEE_PASSWORD configured for authentication
- Basic understanding of web analytics concepts and JavaScript integration
- Website access for embedding Ackee tracking script in HTML pages

## docker-compose.yml

```yaml
services:
  ackee:
    image: electerious/ackee:latest
    container_name: ackee
    environment:
      - ACKEE_MONGODB=mongodb://mongodb:27017/ackee
      - ACKEE_USERNAME=${ACKEE_USERNAME}
      - ACKEE_PASSWORD=${ACKEE_PASSWORD}
    ports:
      - "3000:3000"
    depends_on:
      - mongodb
    networks:
      - ackee-network
    restart: unless-stopped

  mongodb:
    image: mongo:6
    container_name: ackee-mongodb
    volumes:
      - mongo-data:/data/db
    networks:
      - ackee-network
    restart: unless-stopped

volumes:
  mongo-data:

networks:
  ackee-network:
    driver: bridge
```

## .env

```bash
# Ackee Analytics
ACKEE_USERNAME=admin
ACKEE_PASSWORD=secure_ackee_password
```

## Usage notes

- Dashboard at http://localhost:3000
- Login with username/password
- Create domains and get tracking script
- No cookies, GDPR compliant
- Minimal, privacy-first design

## Troubleshooting

- Ackee shows 'Database connection failed': Verify MongoDB container is running and ACKEE_MONGODB environment variable points to mongodb:27017/ackee
- Login fails with correct credentials: Check ACKEE_USERNAME and ACKEE_PASSWORD environment variables are properly set and container has restarted after changes
- No tracking data appears in dashboard: Ensure tracking script is properly embedded in website HTML and domain is correctly configured in Ackee settings
- MongoDB data loss after container restart: Verify mongo-data volume is properly mounted and has sufficient disk space for analytics data storage
- Ackee interface loads slowly or times out: Increase MongoDB memory allocation or check for high analytics data volume requiring database optimization

