# Umami — Modern Privacy-Focused Website Analytics > Umami is an open-source, privacy-focused analytics platform and Google Analytics alternative with real-time dashboards, event tracking, and multi-site support. ## Install Save the content below to `.claude/skills/` or append to your `CLAUDE.md`: ## Quick Use ```bash git clone https://github.com/umami-software/umami.git cd umami cp .env.example .env # Set DATABASE_URL in .env npm install npx prisma migrate deploy npm run build npm start ``` Open `http://localhost:3000` — login with admin/umami and add your first website. ## Intro **Umami** is an open-source, privacy-focused web analytics platform that serves as a modern alternative to Google Analytics, Mixpanel, and Amplitude. Built with Next.js and supporting both PostgreSQL and MySQL, it provides beautiful real-time dashboards, custom event tracking, and product analytics features — all without cookies and fully GDPR compliant. With 36K+ GitHub stars and MIT license, Umami is one of the most popular open-source analytics solutions, trusted by thousands of websites worldwide for its simplicity, performance, and respect for user privacy. ## What Umami Does Umami provides comprehensive analytics across web and product metrics: - **Real-time Dashboard**: Live visitor count, page views, sessions, and geographic distribution - **Page Analytics**: Detailed per-page metrics with entry/exit tracking and flow visualization - **Custom Events**: Track button clicks, form submissions, signups, purchases, and any user interaction - **User Journey**: Session replay, funnel analysis, and conversion path tracking - **Audience Segmentation**: Filter by country, device, browser, OS, referrer, and custom properties - **UTM Tracking**: Campaign attribution with source, medium, campaign, term, and content parameters - **Multi-site**: Manage unlimited websites from a single dashboard with team sharing ## Architecture ``` ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │ Your Site │────▶│ Umami │────▶│ PostgreSQL │ │ (Tracker) │ │ (Next.js) │ │ or MySQL │ └──────────────┘ └──────┬───────┘ └──────────────┘ │ ┌──────┴───────┐ │ Dashboard │ │ (React UI) │ └──────────────┘ ``` ## Installation ### Docker Compose (Recommended) ```yaml services: umami: image: ghcr.io/umami-software/umami:postgresql-latest ports: - "3000:3000" environment: DATABASE_URL: postgresql://umami:umami@db:5432/umami DATABASE_TYPE: postgresql APP_SECRET: your-random-secret depends_on: db: condition: service_healthy db: image: postgres:16-alpine environment: POSTGRES_DB: umami POSTGRES_USER: umami POSTGRES_PASSWORD: umami volumes: - umami-db:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U umami"] interval: 5s timeout: 5s retries: 5 volumes: umami-db: ``` ```bash docker compose up -d # Login: admin / umami ``` ### One-Click Deploy Umami supports one-click deployment to: - **Vercel**: Connect GitHub repo → auto-deploy with PostgreSQL (Neon/Supabase) - **Railway**: Template-based deploy with built-in PostgreSQL - **DigitalOcean**: App Platform with managed database ## Tracking Setup ### Basic Page Tracking ```html ``` The tracking script is only 2KB gzipped and loads asynchronously — zero impact on page performance. ### Custom Event Tracking ```javascript // Track button click umami.track('signup-click', { plan: 'pro', source: 'landing' }); // Track form submission umami.track('contact-form', { type: 'enterprise', company: 'Acme Corp' }); // Track page view with custom data umami.track({ url: '/virtual-page', title: 'Custom Page' }); ``` ### React/Next.js Integration ```tsx import Script from 'next/script'; export default function RootLayout({ children }) { return (