Log inSign up

Umami: simple, cookie-free analytics on a small VPS

Run the official Umami container with a PostgreSQL container in one Compose file, set DATABASE_URL and a random APP_SECRET, and bind port 3000 to localhost. Nginx with a Certbot certificate publishes it, you sign in as admin with the password umami, change that password, and paste the tracker tag into your site.

Topic: Self-hosted apps · Tested on: Ubuntu 24.04 and 22.04, Debian 12 and 13 · Updated 2026-12-03

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 32

Save /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/heartbeat

The 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.net

The 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:

  1. Open Settings, Websites, and add a site with its name and domain, such as example.net.
  2. 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>.
  3. 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.gz

Restore 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 -f

Before 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.js loads and the /api/send request returns 200.
  • Requests blocked by CSP: add umami.example.net to script-src and connect-src.
  • Wrong locations: the proxy is not forwarding the client address.
  • Login fails after an update: check docker compose logs umami for 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.

All prices
PlanFits becauseSizeMonthlyOrder from
A1-1one or two small sites1 vCPU, 1 GB RAM, 25 GB NVMe$3.60/mo$43.20 for 12 months
A1-2several sites or shared with other apps1 vCPU, 2 GB RAM, 50 GB NVMe$7.20/mo$43.20 for 6 months

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.