Skip to content

Installation

Maurice edited this page Apr 3, 2026 · 6 revisions

Installation

Requirements

  • Docker (20.10+)
  • ~512 MB RAM
  • ~200 MB disk space (plus storage for uploads)

Quick Start

docker run -d -p 3000:3000 -v ./data:/app/data -v ./uploads:/app/uploads mauriceboe/trek

Open http://localhost:3000 — on first boot an admin account is created automatically (see First Login).

Docker Compose (recommended)

Create a docker-compose.yml:

services:
  app:
    image: mauriceboe/trek:latest
    container_name: trek
    ports:
      - "3000:3000"
    environment:
      - NODE_ENV=production
      - PORT=3000
      - TZ=Europe/Berlin  # Optional: set container timezone for backup scheduling
      # - ADMIN_EMAIL=admin@trek.local   # Initial admin e-mail (only used on first boot)
      # - ADMIN_PASSWORD=changeme        # Initial admin password (only used on first boot)
      # - OIDC_ISSUER=https://auth.example.com/realms/main
      # - OIDC_CLIENT_ID=trek
      # - OIDC_CLIENT_SECRET=your-client-secret
      # - OIDC_DISPLAY_NAME=SSO
      # - OIDC_ONLY=false
    volumes:
      - ./data:/app/data
      - ./uploads:/app/uploads
    restart: unless-stopped
docker compose up -d

Multi-arch support: The Docker image is built for both AMD64 and ARM64 (e.g. Raspberry Pi, Apple Silicon).

Data Storage

Path Contents
./data/travel.db SQLite database (trips, users, settings)
./data/.jwt_secret Auto-generated JWT secret (keeps sessions valid across restarts)
./data/backups/ Auto-backup archives
./uploads/photos/ Trip photos
./uploads/files/ Documents and attachments
./uploads/covers/ Trip cover images
./uploads/avatars/ User profile pictures

All data persists across container restarts via the mounted volumes.

First Login

On first boot (when no users exist yet), TREK automatically creates an admin account.

Option A — Custom credentials (recommended for PaaS / headless deployments):

Set the following environment variables before the first start:

Variable Description
ADMIN_EMAIL Email for the initial admin account (default: admin@trek.local)
ADMIN_PASSWORD Password for the initial admin account

Both must be set together. If either is missing, TREK falls back to Option B.

Option B — Auto-generated credentials (default):

If ADMIN_EMAIL / ADMIN_PASSWORD are not set, TREK generates a random password and prints the credentials to the container logs:

docker logs trek

Look for the "First Run: Admin Account Created" box showing the email and password.

After logging in:

  1. Go to Admin Panel to configure API keys, SMTP, and addons (all optional)
  2. Start creating trips!

Kubernetes / Helm

TREK includes a Helm chart in the chart/ directory:

helm install trek ./chart \
  --set env.APP_URL=https://trek.example.com \
  --set env.NODE_ENV=production \
  --set secretEnv.ENCRYPTION_KEY=$(openssl rand -hex 32)

Key values:

  • persistence.enabled: true — Creates PVCs for data and uploads (1Gi each by default)
  • ingress.enabled: false — Enable and configure for your domain
  • resources.requests — 100m CPU, 256Mi RAM
  • resources.limits — 500m CPU, 512Mi RAM
  • Health checks on /api/health (liveness + readiness)

See chart/values.yaml for all options.

Unraid

TREK is available as an Unraid Community App template:

  • Search for "TREK" in the Unraid app store
  • Data maps to /mnt/user/appdata/trek/data
  • Uploads map to /mnt/user/appdata/trek/uploads
  • Default port: 3000

Building from Source

git clone https://github.com/mauriceboe/TREK.git
cd TREK
docker build -t trek .
docker run -d -p 3000:3000 -v ./data:/app/data -v ./uploads:/app/uploads trek

Security Notes

  • The container runs as non-root user internally (via su-exec)
  • Volume permissions are automatically fixed on startup
  • JWT secret is auto-generated and persisted to ./data/.jwt_secret if not set explicitly
  • If you delete the data volume, all users will be logged out

Clone this wiki locally