=> 🏡 Home | Back to notes

Umami

Last updated on 28 September 2022

I use Umami [1] for analytics on this website and a few other services that I run. I self-host Umami using Docker.

=> 1

To start, create a docker-compose.yml:

version: '3'

services:

  umami:
    image: ghcr.io/mikecao/umami:postgresql-latest
    environment:
      DATABASE_URL: postgresql://umami:CHANGEME@umamidb:5432/umami
      DATABASE_TYPE: postgresql
      HASH_SALT: CHANGEME
    depends_on:
      - umamidb
    restart: always
    expose:
      - 3000
    networks:
      - traefik_net
    labels:
      - traefik.http.routers.umami.rule=Host(`CHANGEME`)
      - traefik.http.routers.umami.tls=true
      - traefik.http.routers.umami.tls.certresolver=myresolver

  umamidb:
    image: postgres:12-alpine
    environment:
      POSTGRES_DB: umami
      POSTGRES_USER: umami
      POSTGRES_PASSWORD: CHANGEME
    volumes:
      - ./sql/schema.postgresql.sql:/docker-entrypoint-initdb.d/schema.postgresql.sql:ro
      - ./umami-data:/var/lib/postgresql/data
    restart: always
    networks:
      - traefik_net

networks:
  traefik_net:
    external: true

HTTPS

Since Umami must be publicly-accessible (so it can measure analytics on public websites), it must also be served over HTTPS.

The docker-compose.yml above puts the containers into the traefik_net network. See the Traefik [2] note for more information on setting this up.

=> 2

Backing-up

Back-up Umami using the filesystem backups in the Backup [3] note.

=> 3

=> Back to notes

Proxy Information
Original URL
gemini://wilw.capsule.town/notes/umami.gmi
Status Code
Success (20)
Meta
text/gemini;lang=en-GB
Capsule Response Time
175.659253 milliseconds
Gemini-to-HTML Time
0.717627 milliseconds

This content has been proxied by September (ba2dc).