Analytics are optional and disabled by default. This guide shows how to enable self-hosted Umami analytics to track:
- Website visits (automatic pageviews)
- Run starts (custom event)
- Run completions (custom event)
Umami is open source, privacy-first (no cookies), and you control all data on your own infrastructure.
Note: The production example at devkeys.app has analytics enabled to demonstrate the feature. Your self-hosted instance will have analytics disabled by default.
Using your preferred container orchestration platform (Dokploy, Coolify, Docker Compose, etc.):
- Create New Project → Docker Compose
- Name it "umami-analytics"
- Paste this docker-compose configuration:
services:
umami:
image: ghcr.io/umami-software/umami:postgresql-latest
environment:
DATABASE_URL: postgresql://umami:umami@db:5432/umami
DATABASE_TYPE: postgresql
APP_SECRET: ${APP_SECRET}
depends_on:
db:
condition: service_healthy
restart: always
healthcheck:
test: ["CMD-SHELL", "curl http://localhost:3000/api/heartbeat"]
interval: 5s
timeout: 5s
retries: 5
db:
image: postgres:15-alpine
environment:
POSTGRES_DB: umami
POSTGRES_USER: umami
POSTGRES_PASSWORD: umami
volumes:
- umami-db-data:/var/lib/postgresql/data
restart: always
healthcheck:
test: ["CMD-SHELL", "pg_isready -U umami -d umami"]
interval: 5s
timeout: 5s
retries: 5
volumes:
umami-db-data:-
Set Environment Variables:
- Copy
env.exampleto.envand update the values UMAMI_APP_SECRET= generate random 32-char stringVITE_ANALYTICS_URL= your analytics domain (e.g.,https://analytics.domain/script.js)VITE_ANALYTICS_WEBSITE_ID= your website ID from Umami dashboard
- Copy
-
Configure Domain: Set up subdomain like
analytics.domain -
Enable HTTPS: Most platforms auto-generate SSL via Let's Encrypt
-
Deploy and wait for health checks to pass
-
Initial Setup:
- Visit
https://analytics.domain - Default login:
admin/umami - Change password immediately
- Go to Settings → Websites → Add Website
- Enter your main site domain:
domain - Copy the Website ID from the tracking code
- Visit
- Create New Project → Git Repository
- Connect your GitHub repo
- Platform will auto-detect Vite/React
- Build Settings:
- Build Command:
pnpm install && pnpm build:wasm && pnpm build:web - Publish Directory:
apps/web/dist
- Build Command:
- Configure domain:
domain - Deploy