How to Self-Host Umami Analytics with Docker and PostgreSQL
Описание и применение
Умами можно развернуть локально в Docker, используя PostgreSQL, защищая порт 3000 привязкой к 127.0.0.1 и хранением секретов в .env.
Задача
Run a privacy‑friendly analytics platform on your own server without exposing the admin interface to the internet.
Результат
Umami runs locally on port 3000, protected by a reverse proxy, with all secrets securely stored in a .env file. The default admin login is changed immediately, and the database migrations complete successfully.
Рабочий процесс
- Create a project directory and generate a .env file with POSTGRES_PASSWORD, APP_SECRET, and TWO_FACTOR_ENCRYPTION_KEY using openssl
- Write a docker‑compose.yml that pulls ghcr.io/umami-software/umami:3.4.0 and postgres:15.19-alpine, binds port 127.0.0.1:3000:3000, and references the .env variables
- Run docker compose up -d and monitor logs to ensure migrations apply and the heartbeat endpoint responds
- Access http://localhost:3000, change the default admin password via the dashboard or API, then add a website and embed the tracking script
Доказательства
Umami is a small, privacy-friendly alternative to Google Analytics. You can run it yourself with two containers: the app and a PostgreSQL database.
Put POSTGRES_PASSWORD, APP_SECRET and TWO_FACTOR_ENCRYPTION_KEY in a .env file. Choose the database password once, because changing it later breaks the app.
Bind the port to 127.0.0.1:3000 and put Caddy in front for HTTPS.
The default login is admin / umami. Change the password before you do anything else, then add your website and paste the tracking script into your site's <head>.
- Дата записи: 2026-10-18T07:56:04.130Z