On this page
- Why pick Umami and what size server fits?
- How do you write the Compose file?
- How do you start Umami and test it?
- How do you add Nginx and a certificate?
- What should you do after the first login?
- How do you track events and keep the script from being blocked?
- Does Umami need outgoing mail?
- How do you back up and update Umami?
- What if no visits appear?
- Questions
Why pick Umami and what size server fits?
Umami is a Next.js application that keeps its data in PostgreSQL, with no separate analytics engine. That keeps it light: 1 GB of memory runs a handful of small sites, and 2 GB is plenty for steady traffic on several domains. It sits well beside other apps on the same server.
Prepare Ubuntu 24.04, Ubuntu 22.04, Debian 12 or Debian 13 with Docker Engine and the Compose plugin; the Docker Engine tutorial covers it, or start from the Docker image. Add an A and AAAA record for umami.example.net following DNS records.
How do you write the Compose file?
Create a folder and two secrets, then the Compose file.
sudo mkdir -p /opt/umami && cd /opt/umami
openssl rand -hex 20
openssl rand -hex 32Save /opt/umami/compose.yaml with the first value as the database password and the second as APP_SECRET:
services:
umami:
image: ghcr.io/umami-software/umami:latest
restart: unless-stopped
ports:
- "127.0.0.1:3000:3000"
environment:
DATABASE_URL: postgresql://umami:db-pass-here@db:5432/umami
APP_SECRET: app-secret-here
depends_on:
db:
condition: service_healthy
db:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_DB: umami
POSTGRES_USER: umami
POSTGRES_PASSWORD: db-pass-here
volumes:
- umami-db:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U umami -d umami"]
interval: 5s
timeout: 5s
retries: 5
volumes:
umami-db:Current Umami releases use PostgreSQL only. Older 2.x guides refer to tags such as postgresql-latest; compare with the Compose file in the project repository for the release you deploy, and pin a version tag once you settle on one.
How do you start Umami and test it?
cd /opt/umami
sudo docker compose up -d
sudo docker compose ps
sudo docker compose logs --tail 30 umami
curl -s http://127.0.0.1:3000/api/heartbeatThe heartbeat endpoint answers {"ok":true} when the app is up. The first start creates the tables, so allow it half a minute.
How do you add Nginx and a certificate?
A plain proxy block is enough; Umami needs no WebSockets.
server {
listen 80;
listen [::]:80;
server_name umami.example.net;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}sudo nano /etc/nginx/sites-available/umami
sudo ln -s /etc/nginx/sites-available/umami /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx
sudo ufw allow 'Nginx Full'
sudo certbot --nginx -d umami.example.netThe forwarded headers matter: Umami derives the country and the unique visitor hash from the client address. Install Nginx and Certbot first if needed, as described in the Nginx guide and the Certbot guide.
What should you do after the first login?
Go to https://umami.example.net and sign in with the username admin and password umami. Change the password straight away under the profile menu, since every Umami install starts with the same pair. Then:
- Open Settings, Websites, and add a site with its name and domain, such as
example.net. - Open the site entry and copy the tracking code. It looks like
<script defer src="https://umami.example.net/script.js" data-website-id="..."></script>. - Paste it into the head of every page, deploy, and load the site once; the realtime view shows the visit.
Create extra users or teams in the settings if others need to read the numbers.
How do you track events and keep the script from being blocked?
Clicks and conversions can be recorded without writing JavaScript: add data-umami-event="signup" to a button or link and it appears as an event in the dashboard. For custom code, call umami.track('signup') after the script loads.
Some privacy filters block files named script.js from analytics hosts. You can rename the tracker with the TRACKER_SCRIPT_NAME variable (for example stats.js) and update the tag. Respect your visitors either way: Umami sets no cookies, and you can honour Do Not Track with the data-do-not-track="true" attribute.
Does Umami need outgoing mail?
No. Umami has no built-in email features, so there is nothing to configure here and no port 25 question for this app. If you run other services on the same server that send mail, set them up with an authenticated relay on port 587 as shown in the SMTP relay guide, and ask support in a ticket before planning direct delivery on port 25.
How do you back up and update Umami?
All data sits in the PostgreSQL volume, so a single dump covers it:
cd /opt/umami
sudo docker compose exec -T db pg_dump -U umami umami | gzip > ~/umami-$(date +%F).sql.gz
ls -lh ~/umami-*.sql.gzRestore into a fresh stack with gunzip -c file.sql.gz | sudo docker compose exec -T db psql -U umami umami. Updating is a pull and restart; schema migrations run when the container starts:
sudo docker compose pull umami
sudo docker compose up -d
sudo docker image prune -fBefore crossing a major version, read the upgrade notes in the project repository. Major Umami releases have changed the database layout and supported databases in the past.
What if no visits appear?
- Realtime stays at zero: open the browser developer tools on your site and check that
script.jsloads and the/api/sendrequest returns 200. - Requests blocked by CSP: add
umami.example.nettoscript-srcandconnect-src. - Wrong locations: the proxy is not forwarding the client address.
- Login fails after an update: check
docker compose logs umamifor a migration error and restore the dump if needed.
For a heavier tool with ClickHouse, compare Plausible CE; for more apps to host, see self-hosting.
Plans that fit this guide
Base city prices. Every plan includes a dedicated IPv4 address, IPv6, full root and all 18 images.
Questions about Umami analytics
What is the default Umami login?
Username admin, password umami. Change it right after the first sign-in.
Does Umami use cookies?
No. It identifies sessions with a salted hash and stores no cookies in the visitor browser.
Can Umami track several websites?
Yes. Add each site in the settings; each gets its own website ID for the tracking tag.
Can I run Umami with MySQL?
Older 2.x releases supported MySQL. Current releases target PostgreSQL, so new installs should use it.
How much memory does Umami need?
About 1 GB covers the app and database for small sites. Pick 2 GB when you also run other containers on the server.
More in Self-hosted apps
- Nextcloud on Nginx
- ownCloud Infinite Scale
- Seafile file sync
- Vaultwarden password vault
- Passbolt team password manager
- Gitea Git hosting
- Forgejo Git server
- GitLab Community Edition
- Gogs Git service
- Wiki.js
- BookStack documentation
- Outline knowledge base
- Paperless-ngx documents
- n8n workflow automation
- Activepieces automation
- Plausible Analytics (Community Edition)
- Mattermost team chat
- Matrix Synapse with Element
- Jitsi Meet video calls
- ONLYOFFICE Docs with Nextcloud
- HashiCorp Vault secrets server
- OpenBao secrets management
- Infisical secrets manager
- Authelia SSO and forward auth
- Zitadel identity platform
- VS Code in the browser (code-server)
- Joplin Server for notes sync
- Firefly III personal finance
- Snipe-IT asset tracking
- Odoo ERP on Ubuntu or Debian
- ERPNext with frappe_docker
- Dolibarr ERP and CRM with Nginx
- Penpot design tool with Docker
- Planka kanban boards
- Leantime project management
- Wekan boards with Docker
- Cal.com scheduling
- Chatwoot support inbox
- Mautic marketing automation
- DocuSeal document signing
- Metabase dashboards
- Appwrite backend server
- Self-hosted Supabase
- PocketBase backend
- RustDesk relay server
- Traccar GPS tracking
- Redmine project tracker
- The Lounge IRC client
- CyberChef data toolbox
- Typebot chat forms
- AFFiNE workspace
- Overleaf Community Edition
- Neko shared virtual browser
- imgproxy image resizing
- NetBox network inventory
- UVdesk help desk
- YetiForce CRM