docker.recipes

Umami Analytics

beginner

Simple, fast, privacy-focused website analytics alternative to Google Analytics

Overview

Umami Analytics is an open-source, privacy-first web analytics platform that serves as a powerful alternative to Google Analytics. Built with a focus on simplicity and data privacy, Umami collects only essential metrics without using cookies or tracking personal information, making it inherently GDPR and CCPA compliant. The platform provides clean, intuitive dashboards showing visitor counts, page views, referrers, and user behavior patterns while respecting user privacy. This deployment combines the Umami analytics server with a PostgreSQL database backend, creating a complete analytics solution. The Umami container runs the Node.js-based web application and API server, while the PostgreSQL database stores all analytics data with ACID compliance and robust performance. The configuration uses health checks to ensure the database is ready before starting Umami, and includes telemetry disabling for complete privacy control. This stack is ideal for organizations, bloggers, and developers who want comprehensive website analytics without compromising visitor privacy or depending on third-party services. The combination of Umami's lightweight interface with PostgreSQL's reliability creates a scalable analytics platform that can handle everything from personal blogs to high-traffic websites while maintaining complete data ownership and privacy compliance.

Key Features

  • Cookie-free tracking that complies with GDPR, CCPA, and other privacy regulations without requiring consent banners
  • Real-time analytics dashboard showing live visitor activity, page views, and traffic sources with clean visualizations
  • Multi-website support allowing unlimited website tracking from a single Umami instance with separate analytics
  • Custom event tracking for monitoring button clicks, form submissions, downloads, and other user interactions
  • Geographic visitor data showing countries and regions without collecting personally identifiable information
  • Device and browser analytics providing insights into visitor technology preferences and mobile usage patterns
  • PostgreSQL backend ensuring ACID compliance, complex query capabilities, and reliable data persistence for analytics
  • Self-hosted solution providing complete data ownership and control over analytics information and user privacy

Common Use Cases

  • 1Privacy-conscious businesses replacing Google Analytics to comply with European GDPR requirements
  • 2Content creators and bloggers monitoring website performance without compromising visitor privacy
  • 3Educational institutions tracking student portal usage while maintaining strict privacy standards
  • 4E-commerce sites analyzing customer behavior and conversion funnels without invasive tracking
  • 5Government and healthcare organizations requiring analytics that meet strict data protection regulations
  • 6Marketing agencies managing analytics for multiple clients from a centralized, privacy-compliant platform
  • 7Developers testing and optimizing web applications with detailed performance and usage metrics

Prerequisites

  • Docker and Docker Compose installed with at least 1GB available RAM for PostgreSQL performance
  • Port 3000 available for Umami web interface, or configure custom port via UMAMI_PORT environment variable
  • Strong passwords set for POSTGRES_PASSWORD and APP_SECRET environment variables before deployment
  • Basic understanding of web analytics concepts and JavaScript tracking code implementation
  • Administrative access to websites where you plan to install Umami tracking scripts
  • Understanding of PostgreSQL basics for potential database maintenance and backup procedures

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 umami:
3 image: ghcr.io/umami-software/umami:postgresql-latest
4 container_name: umami
5 restart: unless-stopped
6 ports:
7 - "${UMAMI_PORT:-3000}:3000"
8 environment:
9 - DATABASE_URL=postgresql://umami:${POSTGRES_PASSWORD}@db:5432/umami
10 - DATABASE_TYPE=postgresql
11 - APP_SECRET=${APP_SECRET}
12 - DISABLE_TELEMETRY=1
13 depends_on:
14 db:
15 condition: service_healthy
16
17 db:
18 image: postgres:15-alpine
19 container_name: umami-db
20 restart: unless-stopped
21 environment:
22 - POSTGRES_DB=umami
23 - POSTGRES_USER=umami
24 - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
25 volumes:
26 - umami_db_data:/var/lib/postgresql/data
27 healthcheck:
28 test: ["CMD-SHELL", "pg_isready -U umami"]
29 interval: 5s
30 timeout: 5s
31 retries: 5
32
33volumes:
34 umami_db_data:

.env Template

.env
1# Umami Configuration
2UMAMI_PORT=3000
3
4# Database password
5POSTGRES_PASSWORD=umami_password
6
7# App secret (generate with: openssl rand -base64 32)
8APP_SECRET=your-random-secret-string

Usage Notes

  1. 1Dashboard at http://localhost:3000
  2. 2Default login: admin / umami
  3. 3Change password after first login
  4. 4Add websites and get tracking code
  5. 5Privacy-focused - no cookies
  6. 6GDPR/CCPA compliant out of the box

Individual Services(2 services)

Copy individual services to mix and match with your existing compose files.

umami
umami:
  image: ghcr.io/umami-software/umami:postgresql-latest
  container_name: umami
  restart: unless-stopped
  ports:
    - ${UMAMI_PORT:-3000}:3000
  environment:
    - DATABASE_URL=postgresql://umami:${POSTGRES_PASSWORD}@db:5432/umami
    - DATABASE_TYPE=postgresql
    - APP_SECRET=${APP_SECRET}
    - DISABLE_TELEMETRY=1
  depends_on:
    db:
      condition: service_healthy
db
db:
  image: postgres:15-alpine
  container_name: umami-db
  restart: unless-stopped
  environment:
    - POSTGRES_DB=umami
    - POSTGRES_USER=umami
    - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
  volumes:
    - umami_db_data:/var/lib/postgresql/data
  healthcheck:
    test:
      - CMD-SHELL
      - pg_isready -U umami
    interval: 5s
    timeout: 5s
    retries: 5

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 umami:
5 image: ghcr.io/umami-software/umami:postgresql-latest
6 container_name: umami
7 restart: unless-stopped
8 ports:
9 - "${UMAMI_PORT:-3000}:3000"
10 environment:
11 - DATABASE_URL=postgresql://umami:${POSTGRES_PASSWORD}@db:5432/umami
12 - DATABASE_TYPE=postgresql
13 - APP_SECRET=${APP_SECRET}
14 - DISABLE_TELEMETRY=1
15 depends_on:
16 db:
17 condition: service_healthy
18
19 db:
20 image: postgres:15-alpine
21 container_name: umami-db
22 restart: unless-stopped
23 environment:
24 - POSTGRES_DB=umami
25 - POSTGRES_USER=umami
26 - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
27 volumes:
28 - umami_db_data:/var/lib/postgresql/data
29 healthcheck:
30 test: ["CMD-SHELL", "pg_isready -U umami"]
31 interval: 5s
32 timeout: 5s
33 retries: 5
34
35volumes:
36 umami_db_data:
37EOF
38
39# 2. Create the .env file
40cat > .env << 'EOF'
41# Umami Configuration
42UMAMI_PORT=3000
43
44# Database password
45POSTGRES_PASSWORD=umami_password
46
47# App secret (generate with: openssl rand -base64 32)
48APP_SECRET=your-random-secret-string
49EOF
50
51# 3. Start the services
52docker compose up -d
53
54# 4. View logs
55docker 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/umami/run | bash

Troubleshooting

  • Umami container exits with database connection error: Ensure POSTGRES_PASSWORD matches between umami and db services in environment variables
  • Web interface shows 'Internal Server Error' on startup: Check that APP_SECRET environment variable is set to a secure random string
  • Cannot access dashboard at localhost:3000: Verify port 3000 is not in use by another service or change UMAMI_PORT variable
  • Database connection timeouts during startup: Wait for PostgreSQL health check to pass or increase health check timeout values
  • Tracking script not recording data: Verify website tracking code is properly installed and domain matches configured site settings
  • High memory usage from umami-db container: Monitor PostgreSQL performance and consider increasing available RAM or optimizing query patterns

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