Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions analytics/umami/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# PostgreSQL connection string
DATABASE_URL=postgresql://umami_user:umami_password@db:5432/umami

# Secret key for Umami app
APP_SECRET=Insert_your_secure_secret_here
71 changes: 71 additions & 0 deletions analytics/umami/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Umami Analytics Setup

This repository contains a **self-hosted, privacy-first analytics setup using Umami**.
It allows your organization to track user behavior, analyze traffic, and make informed decisions while maintaining full visitor privacy and data ownership.

---

## Requirements

* Server with **Node.js ≥ 18.17**
* **PostgreSQL ≥ 12.14** (or MySQL ≥ 8.0)
* **Docker & Docker Compose**
* Minimum **1GB RAM** recommended

> ⚠️ This setup should run on a separate server. Your main application server may not meet the Node.js/PostgreSQL requirements.

---

## Setup Instructions

### 1. Copy environment variables

```bash
cp .env.example .env
```

### 2. Edit `.env`

* Update the database credentials (`DATABASE_URL`)
* Set a secure `APP_SECRET`

### 3. Start the services

```bash
docker compose up -d
```

This will start:

* **Umami app**
* **PostgreSQL database**

### 4. Access the dashboard

Open in your browser:

```
http://<server-ip>:3000
```

* Create an **admin account**
* Add your **websites** to start tracking

### 5. Add tracking script to your website

```html
<script async src="http://<server-ip>:3000/script.js" data-website-id="YOUR_WEBSITE_ID"></script>
```

* Replace `<server-ip>` with your server domain or IP
* Replace `YOUR_WEBSITE_ID` with the ID shown in the Umami dashboard

---

## Notes

* This setup runs **independently** of the main application server
* **All visitor data is private** and stored only in your database
* You can **scale or back up the database** as needed
* For production, consider using **HTTPS** and a **custom domain**
* This setup is ready for deployment once a server is available
28 changes: 28 additions & 0 deletions analytics/umami/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: "3.8"

services:
db:
image: postgres:15
container_name: umami-db
restart: always
environment:
POSTGRES_DB: umami
POSTGRES_USER: umami_user
POSTGRES_PASSWORD: umami_password
volumes:
- umami-db-data:/var/lib/postgresql/data

umami:
image: umamisoftware/umami:postgresql-latest
container_name: umami
depends_on:
- db
ports:
- "3000:3000"
environment:
DATABASE_URL: postgresql://umami_user:umami_password@db:5432/umami
APP_SECRET: replace_with_secure_secret
restart: always

volumes:
umami-db-data: