TREK Documentation

A self-hosted travel/trip planner with real-time collaboration, interactive maps, PWA support, SSO, budgets, packing lists, and more.

RAW Doc

Docker & Self-Hosted Deployment Verified OCI

Deploy TREK on any server, homelab, or cloud container platform.

1-Click Terminal Command
bash (docker run)
docker run -d --name trek -p 9000:9000 --restart always quay.io/minio/aistor/minio:RELEASE.2026-08-07T18-34-35Z
Configured Services & Ports
โš™๏ธ minio
image: quay.io/minio/aistor/minio:RELEASE.2026-08-07T18-34-35Z
๐Ÿ”Œ Ports: 127.0.0.1:9000:9000, 127.0.0.1:9001:9001
docker-compose.yml
yaml (docker-compose.yml)
# Manual, license-gated live-provider test for the env-gated S3 driver
# contract suite, for local/operator use. CI runs this exact suite for
# same-repo pull requests, via the MINIO_LICENSE_KEY repo secret (see
# .github/workflows/test.yml's s3-contract job) โ€” this compose file stays
# the manual procedure for local runs and for fork PRs, which don't get
# repo secrets and so still need it run by hand.
#
# MinIO fully dropped the community line (quay.io/minio/minio gets no
# further updates). The maintained successor is AIStor
# (quay.io/minio/aistor/minio), which requires a license key to boot at all.
#
# REQUIRED: a `minio-licence.key` file at the repo root (same directory as
# this compose file). It is git-ignored and must never be committed โ€” obtain
# your own free license key from MinIO (https://min.io) and place it there.
# The AIStor container will not start without it.
#
# Verified empirically against RELEASE.2026-08-07T18-34-35Z:
#   - MINIO_ROOT_USER / MINIO_ROOT_PASSWORD still set the root credentials
#     (unchanged from community MinIO).
#   - Command shape: the image entrypoint expects `minio` as its first
#     argument, so `command: minio server /data --license /minio.license`
#     is passed through as-is.
#   - `mc ready local` works as a healthcheck (mc ships in the image; curl
#     does not).
#
# 127.0.0.1 is load-bearing on both sides: aws-lite picks path-style only
# for IP/localhost hosts (stock MinIO/AIStor only speaks path-style, no
# MINIO_DOMAIN here), and the port publish below binds 127.0.0.1 only โ€” not
# 0.0.0.0 โ€” so this fixed-credential test instance is never reachable from
# the LAN.
#
# Procedure:
#   docker compose -f docker-compose.minio-test.yml up -d
#   docker compose -f docker-compose.minio-test.yml ps   # wait for "healthy"
#   cd server && TREK_TEST_S3_ENDPOINT=http://127.0.0.1:9000 \
#     TREK_TEST_S3_BUCKET=trek-test TREK_TEST_S3_ACCESS_KEY_ID=trekci \
#     TREK_TEST_S3_SECRET_ACCESS_KEY=trekci-secret \
#     npx vitest run tests/unit/nest/storage/s3.driver.contract.test.ts
#   (optional) UI check: with the app running against this instance, open
#   Admin โ†’ Storage, add an S3 backend (endpoint http://127.0.0.1:9000,
#   bucket trek-test, access key trekci, secret trekci-secret), press Test
#   on its row and confirm "Connection OK".
#   docker compose -f docker-compose.minio-test.yml down -v
services:
  minio:
    # Docker Hub's minio/minio repo is archived, and quay.io/minio/minio (the
    # former community line) receives no further updates โ€” MinIO dropped it
    # entirely. AIStor is the maintained successor; it requires a license
    # (see header above). Pinned tag.
    image: quay.io/minio/aistor/minio:RELEASE.2026-08-07T18-34-35Z
    command: minio server /data --license /minio.license
    ports:
      - "127.0.0.1:9000:9000"
      - "127.0.0.1:9001:9001"
    volumes:
      - ./minio-licence.key:/minio.license:ro
    environment:
      - MINIO_ROOT_USER=trekci
      - MINIO_ROOT_PASSWORD=trekci-secret
    healthcheck:
      test: ["CMD", "mc", "ready", "local"] # curl was removed from the image
      interval: 2s
      timeout: 5s
      retries: 15

Technical Documentation: mauriceboe/TREK

โ„น๏ธ Provenance: Hybrid Fusion: mauriceboe/TREK (README + 1 In-Tree Chapters) ยท CodeWiki Reference ยท Recency: Active (< 180 days)

1. Project Overview & Quickstart (mauriceboe/TREK)



What you get

See all features

| #### ๐Ÿงญ Trip planning

  • Drag & drop planner โ€” organise places into day plans with reordering and cross-day moves

  • Interactive map โ€” Leaflet or Mapbox GL with 3D buildings, terrain, photo markers, clustering, route visualization

  • Place search โ€” Google Places (photos, ratings, hours) or OpenStreetMap (free, no API key)

  • Place import โ€” shared Google Maps / Naver Maps lists, plus GPX and KML/KMZ/GeoJSON map files

  • Day notes โ€” timestamped, icon-tagged notes with drag-and-drop reordering

  • Route optimisation โ€” auto-sort places and export to Google Maps

  • Weather forecasts โ€” 16-day via Open-Meteo (no key) + historical climate fallback

  • Category filter โ€” show only matching pins on the map | #### ๐Ÿงณ Travel management

  • Reservations โ€” flights, accommodations, restaurants with status, confirmation numbers, files; import from booking confirmation emails and PDFs (KDE Itinerary)

  • Costs โ€” track and split trip expenses (Splitwise-style): per-person / per-day breakdowns, settle-up, multi-currency

  • Packing lists โ€” categories, templates, user assignment, progress tracking

  • Bag tracking โ€” optional weight tracking with iOS-style distribution

  • Document manager โ€” attach docs, tickets, PDFs to trips / places / reservations (โ‰ค 50 MB each)

  • PDF export โ€” full trip plan as PDF with cover page, images, notes |
    | --- | --- |
    | #### ๐Ÿ‘ฅ Collaboration

  • Real-time sync โ€” WebSocket. Changes appear instantly across all connected users

  • Multi-user trips โ€” invite members with role-based access

  • Invite links โ€” one-time or reusable links with expiry

  • SSO (OIDC) โ€” Google, Apple, Authentik, Keycloak, or any OIDC provider

  • 2FA โ€” TOTP + backup codes

  • Passkeys โ€” passwordless WebAuthn login (fingerprint / face / PIN / security key), admin-toggleable

  • Collab suite โ€” group chat, shared notes, polls, day check-ins | #### ๐Ÿ“ฑ Mobile & PWA

  • Installable โ€” iOS and Android, straight from the browser, no App Store needed

  • Offline support โ€” Service Worker caches tiles, API, uploads via Workbox

  • Native feel โ€” fullscreen standalone, themed status bar, splash screen

  • Touch optimised โ€” mobile-specific layouts with safe-area handling |
    | #### ๐Ÿงฉ Addons (admin-toggleable)

  • Lists โ€” packing lists + to-dos with templates, member assignments, optional bag tracking

  • Costs โ€” expense tracker with splits and settle-up (who owes whom), multi-currency

  • Documents โ€” file attachments on trips, places, and reservations

  • Collab โ€” chat, notes, polls, day-by-day attendance

  • Vacay โ€” personal vacation planner with calendar, 100+ country holidays, carry-over tracking

  • Atlas โ€” world map of visited countries, bucket list, travel stats, streak tracking, liquid-glass UI

  • Journey โ€” magazine-style travel journal with entries, photos (Immich/Synology), maps, moods

  • AirTrail โ€” connect a self-hosted AirTrail instance to import and sync flights into reservations

  • MCP โ€” expose TREK to AI assistants via OAuth 2.1 | #### ๐Ÿค– AI / MCP

  • Built-in MCP server โ€” OAuth 2.1 authenticated. 150+ tools, 30 resources

  • Granular scopes โ€” 27 OAuth scopes across 13 permission groups

  • Full automation โ€” AI can create trips, plan days, build packing lists, manage budgets, mark countries visited

  • Pre-built prompts โ€” trip-summary, packing-list, budget-overview

  • Addon-aware โ€” exposes Atlas, Collab, Vacay when those addons are on |
    | #### โš™๏ธ Admin & customisation

  • Dashboard views โ€” card grid or compact list ยท Dark mode โ€” full theme with matching status bar

  • 20 languages โ€” EN, DE, ES, FR, IT, NL, HU, RU, ZH, ZH-TW, PL, CS, AR (RTL), BR, ID, TR, JA, KO, UK, GR

  • Admin panel โ€” users, invites, packing templates, categories, addons, API keys, backups, GitHub history

  • Notifications โ€” per-user preferences across email (SMTP), webhook, ntfy, and an in-app notification center

  • Auto-backups โ€” scheduled with configurable retention ยท Units โ€” ยฐC/ยฐF, 12h/24h, map tile sources, default coordinates | |

Get started in 30 seconds

bash
ENCRYPTION_KEY=$(openssl rand -hex 32) docker run -d -p 3000:3000 \
  -e ENCRYPTION_KEY=$ENCRYPTION_KEY \
  -v ./data:/app/data -v ./uploads:/app/uploads mauriceboe/trek

Open http://localhost:3000. On first boot TREK seeds an admin account โ€” if you set ADMIN_EMAIL/ADMIN_PASSWORD those are used, otherwise the credentials are printed to the container log (docker logs trek).

Tech stack

Real-time sync via WebSocket (ws). Backend on NestJS 11. State with Zustand. Auth via JWT + OAuth 2.1 + OIDC + Passkeys (WebAuthn) + TOTP MFA. Weather via Open-Meteo (no key required). Maps with Leaflet and Mapbox GL.

Docker Compose (production)

Full compose example with secure defaults

yaml
services:
  app:
    image: mauriceboe/trek:latest
    container_name: trek
    read_only: true
    security_opt:
      - no-new-privileges:true
    cap_drop:
      - ALL
    cap_add:
      - CHOWN
      - SETUID
      - SETGID
    tmpfs:
      - /tmp:noexec,nosuid,size=64m
    ports:
      - "3000:3000"
    environment:
      - NODE_ENV=production
      - PORT=3000
      - ENCRYPTION_KEY=${ENCRYPTION_KEY:-}   # generate with: openssl rand -hex 32
      - TZ=${TZ:-UTC}
      - LOG_LEVEL=${LOG_LEVEL:-info}
      - ALLOWED_ORIGINS=${ALLOWED_ORIGINS:-}
      - APP_URL=${APP_URL:-}                 # required for OIDC + email links
      # - FORCE_HTTPS=true                   # behind a TLS-terminating proxy
      # - TRUST_PROXY=1
      # - OIDC_ISSUER=https://auth.example.com
      # - OIDC_CLIENT_ID=trek
      # - OIDC_CLIENT_SECRET=supersecret
      # - OIDC_DISPLAY_NAME=SSO
      # - OIDC_ADMIN_CLAIM=groups
      # - OIDC_ADMIN_VALUE=app-trek-admins
    volumes:
      - ./data:/app/data
      - ./uploads:/app/uploads
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "wget", "-qO-", "http://localhost:3000/api/health"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 15s

Then:

bash
docker compose up -d

HTTPS notes: FORCE_HTTPS=true is optional โ€” it adds a 301 redirect, HSTS, CSP upgrade-insecure-requests, and forces the secure cookie flag. Only use it behind a TLS-terminating reverse proxy. TRUST_PROXY=1 tells the server how many proxies sit in front so real client IPs and X-Forwarded-Proto work.

Helm (Kubernetes)

bash
helm repo add trek https://chart.liketrek.com
helm repo update
helm install trek trek/trek

See charts/README.md for values.

Install as App (PWA)

TREK works as a Progressive Web App โ€” no App Store needed.

  1. Open TREK in the browser (HTTPS required)
  2. iOS: Share โ–ธ Add to Home Screen
  3. Android: Menu โ–ธ Install app (or Add to Home Screen)

TREK then launches fullscreen with its own icon, just like a native app.

Updating

Docker Compose:

bash
docker compose pull && docker compose up -d

Docker run โ€” reuse the original volume paths:

bash
docker pull mauriceboe/trek
docker rm -f trek
docker run -d --name trek -p 3000:3000 -v ./data:/app/data -v ./uploads:/app/uploads --restart unless-stopped mauriceboe/trek

Not sure which paths you used? docker inspect trek --format '{{json .Mounts}}' before removing the container.

Your data stays in the mounted data and uploads volumes โ€” updates never touch it.

[!IMPORTANT]
Mount only the data and uploads directories โ€” -v ./data:/app/data -v ./uploads:/app/uploads. Never mount a volume at /app. Doing so hides the application code shipped in the image and the container fails to start with Cannot find module 'tsconfig-paths/register'. If you previously mounted /app, switch to the two mounts above; your data in data/ and uploads/ is preserved.

Rotating the Encryption Key

If you need to rotate ENCRYPTION_KEY (e.g. upgrading from a version that derived encryption from JWT_SECRET):

bash
docker exec -it trek node --import tsx scripts/migrate-encryption.ts

The script creates a timestamped DB backup before making changes and prompts for old + new keys (input is not echoed).

Reverse Proxy

For production, put TREK behind a TLS-terminating reverse proxy. TREK uses WebSockets for real-time sync, so the proxy must support WebSocket upgrades on /ws.

If you use the MCP addon, the proxy must also pass the Mcp-Session-Id header through in both directions on /mcp โ€” Nginx and Caddy do this by default, but a proxy that strips it makes every tool call open a new session instead of reusing one. See the Reverse Proxy wiki page for details.

Nginx

nginx
server {
    listen 80;
    server_name trek.yourdomain.com;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl http2;
    server_name trek.yourdomain.com;

    ssl_certificate     /etc/ssl/fullchain.pem;
    ssl_certificate_key /etc/ssl/privkey.pem;

    # 500 MB covers backup-restore uploads (capped at 500 MB server-side).
    client_max_body_size 500m;

    location / {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        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;
    }

    location /ws {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        proxy_read_timeout 86400;
    }

    # Only needed if you use the MCP addon. Responses are Server-Sent Events,
    # so buffering must be off or tool results arrive late.
    location /mcp {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        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;
        proxy_buffering off;
        proxy_read_timeout 3600s;
    }
}

Caddy

caddy
trek.yourdomain.com {
    reverse_proxy localhost:3000
}

Caddy handles TLS and WebSockets automatically.

Environment variables

Full reference

Variable Description Default
Core
PORT Server port 3000
NODE_ENV Environment (production / development) production
ENCRYPTION_KEY At-rest encryption key for stored secrets (API keys, MFA, SMTP, OIDC). Recommended: generate with openssl rand -hex 32. If unset, falls back to data/.jwt_secret (existing installs) or auto-generates a key (fresh installs). Auto
TZ Timezone for logs, reminders and cron jobs (e.g. Europe/Berlin) UTC
LOG_LEVEL info = concise user actions, debug = verbose details info
TREK_WIKI_DIR Where the in-app Help pages (/help) read their content from. TREK ships its wiki and serves it from disk, so Help always matches the version you are running โ€” you should not need to set this. Point it at your own directory to serve custom docs. If the path does not exist, Help falls back to fetching the public GitHub wiki (needs outbound network, and tracks the latest release). bundled wiki/
DEFAULT_LANGUAGE Default language on the login page for users with no saved preference. Browser/OS language is auto-detected first; this is the fallback. Supported: de, en, es, fr, hu, nl, br, cs, pl, ru, zh, zh-TW, it, ar, id, tr, ja, ko, uk, gr en
ALLOWED_ORIGINS Comma-separated origins for CORS and email links same-origin
FORCE_HTTPS Optional. When true: 301-redirects HTTP to HTTPS, sends HSTS, adds CSP upgrade-insecure-requests, forces the session cookie secure flag. Useful behind a TLS-terminating reverse proxy. Requires TRUST_PROXY. false
HSTS_INCLUDE_SUBDOMAINS When true: adds the includeSubDomains directive to the HSTS header, extending HTTPS enforcement to all subdomains. Only effective when HSTS is active (FORCE_HTTPS=true or NODE_ENV=production). Leave false if you run other services on sibling subdomains over plain HTTP. false
COOKIE_SECURE Controls the secure flag on the trek_session cookie. Auto-derived: on when NODE_ENV=production or FORCE_HTTPS=true. Escape hatch: set false to allow session cookies over plain HTTP. Not recommended in production. auto
SESSION_DURATION How long a login session stays valid when "Remember me" is unchecked (the default): sets the trek_session JWT exp and issues a browser-session cookie (cleared when the browser closes). Accepts ms-style strings: 1h, 12h, 7d, 30d, 90d. Invalid values warn at startup and fall back to the default. 24h
SESSION_DURATION_REMEMBER Session length when "Remember me" is ticked at login: a longer-lived JWT plus a persistent trek_session cookie that survives browser restarts. Same format and startup-fallback behaviour as SESSION_DURATION. 30d
TRUST_PROXY Number of trusted reverse proxies. Tells the server to read client IP from X-Forwarded-For and protocol from X-Forwarded-Proto. Defaults to 1 in production; off in dev unless set. 1
ALLOW_INTERNAL_NETWORK Allow outbound requests to private/RFC-1918 IPs (e.g. Immich on your LAN). Loopback and link-local addresses remain blocked. false
APP_URL Public base URL of this instance (e.g. https://trek.example.com). Required when OIDC is enabled; used as base for email notification links. โ€”
OIDC / SSO
OIDC_ISSUER OpenID Connect provider URL โ€”
OIDC_CLIENT_ID OIDC client ID โ€”
OIDC_CLIENT_SECRET OIDC client secret โ€”
OIDC_DISPLAY_NAME Label shown on the SSO login button SSO
OIDC_ONLY Force SSO-only mode: disables password login + registration, regardless of Admin > Settings. The first SSO login becomes admin. false
OIDC_ADMIN_CLAIM OIDC claim used to identify admin users โ€”
OIDC_ADMIN_VALUE Value of the OIDC claim that grants admin role โ€”
OIDC_SCOPE Space-separated OIDC scopes. Fully replaces the default โ€” always include openid email profile. openid email profile
OIDC_DISCOVERY_URL Override the auto-constructed OIDC discovery endpoint (e.g. Authentik: .../application/o/trek/.well-known/openid-configuration) โ€”
Initial setup
ADMIN_EMAIL Email for the first admin on initial boot. Must be set together with ADMIN_PASSWORD. If either is omitted a random password is printed to the server log. No effect once a user exists. [email protected]
ADMIN_PASSWORD Password for the first admin on initial boot. Pairs with ADMIN_EMAIL. random
Other
DEMO_MODE Enable demo mode (hourly data resets) false
UNSPLASH_ACCESS_KEY Optional Unsplash Access Key for trip-cover and place-image search. Without one, TREK uses Unsplash's unauthenticated endpoint, which some datacenter/VPS IPs are blocked from. Get a free key at unsplash.com/developers. Overrides any per-admin key set in Admin > Settings (where it can also be configured instead). โ€”
MCP_RATE_LIMIT Max MCP API requests per user per minute 300
MCP_MAX_SESSION_PER_USER Max concurrent MCP sessions per user. At the cap, the least-recently-active session is closed to make room 20

Data & Backups

  • Database โ€” SQLite, stored in ./data/travel.db
  • Uploads โ€” stored in ./uploads/
  • Logs โ€” ./data/logs/trek.log (auto-rotated)
  • Backups โ€” create and restore via Admin Panel
  • Auto-Backups โ€” configurable schedule and retention in Admin Panel

Data sources

The Atlas map's country and sub-national (province/county) boundaries come from
geoBoundaries (Runfola et al., 2020), licensed
CC BY 4.0. See NOTICE.md
for full third-party attributions.

License

TREK is AGPL v3. Self-host freely for personal or internal company use. If you modify and offer TREK as a network service to third parties, your modifications must be open-sourced under the same licence.

2. In-Tree Documentation Chapters (mauriceboe/TREK)



What you get

See all features

| #### ๐Ÿงญ Trip planning

  • Drag & drop planner โ€” organise places into day plans with reordering and cross-day moves

  • Interactive map โ€” Leaflet or Mapbox GL with 3D buildings, terrain, photo markers, clustering, route visualization

  • Place search โ€” Google Places (photos, ratings, hours) or OpenStreetMap (free, no API key)

  • Place import โ€” shared Google Maps / Naver Maps lists, plus GPX and KML/KMZ/GeoJSON map files

  • Day notes โ€” timestamped, icon-tagged notes with drag-and-drop reordering

  • Route optimisation โ€” auto-sort places and export to Google Maps

  • Weather forecasts โ€” 16-day via Open-Meteo (no key) + historical climate fallback

  • Category filter โ€” show only matching pins on the map | #### ๐Ÿงณ Travel management

  • Reservations โ€” flights, accommodations, restaurants with status, confirmation numbers, files; import from booking confirmation emails and PDFs (KDE Itinerary)

  • Costs โ€” track and split trip expenses (Splitwise-style): per-person / per-day breakdowns, settle-up, multi-currency

  • Packing lists โ€” categories, templates, user assignment, progress tracking

  • Bag tracking โ€” optional weight tracking with iOS-style distribution

  • Document manager โ€” attach docs, tickets, PDFs to trips / places / reservations (โ‰ค 50 MB each)

  • PDF export โ€” full trip plan as PDF with cover page, images, notes |
    | --- | --- |
    | #### ๐Ÿ‘ฅ Collaboration

  • Real-time sync โ€” WebSocket. Changes appear instantly across all connected users

  • Multi-user trips โ€” invite members with role-based access

  • Invite links โ€” one-time or reusable links with expiry

  • SSO (OIDC) โ€” Google, Apple, Authentik, Keycloak, or any OIDC provider

  • 2FA โ€” TOTP + backup codes

  • Passkeys โ€” passwordless WebAuthn login (fingerprint / face / PIN / security key), admin-toggleable

  • Collab suite โ€” group chat, shared notes, polls, day check-ins | #### ๐Ÿ“ฑ Mobile & PWA

  • Installable โ€” iOS and Android, straight from the browser, no App Store needed

  • Offline support โ€” Service Worker caches tiles, API, uploads via Workbox

  • Native feel โ€” fullscreen standalone, themed status bar, splash screen

  • Touch optimised โ€” mobile-specific layouts with safe-area handling |
    | #### ๐Ÿงฉ Addons (admin-toggleable)

  • Lists โ€” packing lists + to-dos with templates, member assignments, optional bag tracking

  • Costs โ€” expense tracker with splits and settle-up (who owes whom), multi-currency

  • Documents โ€” file attachments on trips, places, and reservations

  • Collab โ€” chat, notes, polls, day-by-day attendance

  • Vacay โ€” personal vacation planner with calendar, 100+ country holidays, carry-over tracking

  • Atlas โ€” world map of visited countries, bucket list, travel stats, streak tracking, liquid-glass UI

  • Journey โ€” magazine-style travel journal with entries, photos (Immich/Synology), maps, moods

  • AirTrail โ€” connect a self-hosted AirTrail instance to import and sync flights into reservations

  • MCP โ€” expose TREK to AI assistants via OAuth 2.1 | #### ๐Ÿค– AI / MCP

  • Built-in MCP server โ€” OAuth 2.1 authenticated. 150+ tools, 30 resources

  • Granular scopes โ€” 27 OAuth scopes across 13 permission groups

  • Full automation โ€” AI can create trips, plan days, build packing lists, manage budgets, mark countries visited

  • Pre-built prompts โ€” trip-summary, packing-list, budget-overview

  • Addon-aware โ€” exposes Atlas, Collab, Vacay when those addons are on |
    | #### โš™๏ธ Admin & customisation

  • Dashboard views โ€” card grid or compact list ยท Dark mode โ€” full theme with matching status bar

  • 20 languages โ€” EN, DE, ES, FR, IT, NL, HU, RU, ZH, ZH-TW, PL, CS, AR (RTL), BR, ID, TR, JA, KO, UK, GR

  • Admin panel โ€” users, invites, packing templates, categories, addons, API keys, backups, GitHub history

  • Notifications โ€” per-user preferences across email (SMTP), webhook, ntfy, and an in-app notification center

  • Auto-backups โ€” scheduled with configurable retention ยท Units โ€” ยฐC/ยฐF, 12h/24h, map tile sources, default coordinates | |

Get started in 30 seconds

bash
ENCRYPTION_KEY=$(openssl rand -hex 32) docker run -d -p 3000:3000 \
  -e ENCRYPTION_KEY=$ENCRYPTION_KEY \
  -v ./data:/app/data -v ./uploads:/app/uploads mauriceboe/trek

Open http://localhost:3000. On first boot TREK seeds an admin account โ€” if you set ADMIN_EMAIL/ADMIN_PASSWORD those are used, otherwise the credentials are printed to the container log (docker logs trek).

Tech stack

Real-time sync via WebSocket (ws). Backend on NestJS 11. State with Zustand. Auth via JWT + OAuth 2.1 + OIDC + Passkeys (WebAuthn) + TOTP MFA. Weather via Open-Meteo (no key required). Maps with Leaflet and Mapbox GL.

Docker Compose (production)

Full compose example with secure defaults

yaml
services:
  app:
    image: mauriceboe/trek:latest
    container_name: trek
    read_only: true
    security_opt:
      - no-new-privileges:true
    cap_drop:
      - ALL
    cap_add:
      - CHOWN
      - SETUID
      - SETGID
    tmpfs:
      - /tmp:noexec,nosuid,size=64m
    ports:
      - "3000:3000"
    environment:
      - NODE_ENV=production
      - PORT=3000
      - ENCRYPTION_KEY=${ENCRYPTION_KEY:-}   # generate with: openssl rand -hex 32
      - TZ=${TZ:-UTC}
      - LOG_LEVEL=${LOG_LEVEL:-info}
      - ALLOWED_ORIGINS=${ALLOWED_ORIGINS:-}
      - APP_URL=${APP_URL:-}                 # required for OIDC + email links
      # - FORCE_HTTPS=true                   # behind a TLS-terminating proxy
      # - TRUST_PROXY=1
      # - OIDC_ISSUER=https://auth.example.com
      # - OIDC_CLIENT_ID=trek
      # - OIDC_CLIENT_SECRET=supersecret
      # - OIDC_DISPLAY_NAME=SSO
      # - OIDC_ADMIN_CLAIM=groups
      # - OIDC_ADMIN_VALUE=app-trek-admins
    volumes:
      - ./data:/app/data
      - ./uploads:/app/uploads
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "wget", "-qO-", "http://localhost:3000/api/health"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 15s

Then:

bash
docker compose up -d

HTTPS notes: FORCE_HTTPS=true is optional โ€” it adds a 301 redirect, HSTS, CSP upgrade-insecure-requests, and forces the secure cookie flag. Only use it behind a TLS-terminating reverse proxy. TRUST_PROXY=1 tells the server how many proxies sit in front so real client IPs and X-Forwarded-Proto work.

Helm (Kubernetes)

bash
helm repo add trek https://chart.liketrek.com
helm repo update
helm install trek trek/trek

See charts/README.md for values.

Install as App (PWA)

TREK works as a Progressive Web App โ€” no App Store needed.

  1. Open TREK in the browser (HTTPS required)
  2. iOS: Share โ–ธ Add to Home Screen
  3. Android: Menu โ–ธ Install app (or Add to Home Screen)

TREK then launches fullscreen with its own icon, just like a native app.

Updating

Docker Compose:

bash
docker compose pull && docker compose up -d

Docker run โ€” reuse the original volume paths:

bash
docker pull mauriceboe/trek
docker rm -f trek
docker run -d --name trek -p 3000:3000 -v ./data:/app/data -v ./uploads:/app/uploads --restart unless-stopped mauriceboe/trek

Not sure which paths you used? docker inspect trek --format '{{json .Mounts}}' before removing the container.

Your data stays in the mounted data and uploads volumes โ€” updates never touch it.

[!IMPORTANT]
Mount only the data and uploads directories โ€” -v ./data:/app/data -v ./uploads:/app/uploads. Never mount a volume at /app. Doing so hides the application code shipped in the image and the container fails to start with Cannot find module 'tsconfig-paths/register'. If you previously mounted /app, switch to the two mounts above; your data in data/ and uploads/ is preserved.

Rotating the Encryption Key

If you need to rotate ENCRYPTION_KEY (e.g. upgrading from a version that derived encryption from JWT_SECRET):

bash
docker exec -it trek node --import tsx scripts/migrate-encryption.ts

The script creates a timestamped DB backup before making changes and prompts for old + new keys (input is not echoed).

Reverse Proxy

For production, put TREK behind a TLS-terminating reverse proxy. TREK uses WebSockets for real-time sync, so the proxy must support WebSocket upgrades on /ws.

If you use the MCP addon, the proxy must also pass the Mcp-Session-Id header through in both directions on /mcp โ€” Nginx and Caddy do this by default, but a proxy that strips it makes every tool call open a new session instead of reusing one. See the Reverse Proxy wiki page for details.

Nginx

nginx
server {
    listen 80;
    server_name trek.yourdomain.com;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl http2;
    server_name trek.yourdomain.com;

    ssl_certificate     /etc/ssl/fullchain.pem;
    ssl_certificate_key /etc/ssl/privkey.pem;

    # 500 MB covers backup-restore uploads (capped at 500 MB server-side).
    client_max_body_size 500m;

    location / {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        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;
    }

    location /ws {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        proxy_read_timeout 86400;
    }

    # Only needed if you use the MCP addon. Responses are Server-Sent Events,
    # so buffering must be off or tool results arrive late.
    location /mcp {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        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;
        proxy_buffering off;
        proxy_read_timeout 3600s;
    }
}

Caddy

caddy
trek.yourdomain.com {
    reverse_proxy localhost:3000
}

Caddy handles TLS and WebSockets automatically.

Environment variables

Full reference

Variable Description Default
Core
PORT Server port 3000
NODE_ENV Environment (production / development) production
ENCRYPTION_KEY At-rest encryption key for stored secrets (API keys, MFA, SMTP, OIDC). Recommended: generate with openssl rand -hex 32. If unset, falls back to data/.jwt_secret (existing installs) or auto-generates a key (fresh installs). Auto
TZ Timezone for logs, reminders and cron jobs (e.g. Europe/Berlin) UTC
LOG_LEVEL info = concise user actions, debug = verbose details info
TREK_WIKI_DIR Where the in-app Help pages (/help) read their content from. TREK ships its wiki and serves it from disk, so Help always matches the version you are running โ€” you should not need to set this. Point it at your own directory to serve custom docs. If the path does not exist, Help falls back to fetching the public GitHub wiki (needs outbound network, and tracks the latest release). bundled wiki/
DEFAULT_LANGUAGE Default language on the login page for users with no saved preference. Browser/OS language is auto-detected first; this is the fallback. Supported: de, en, es, fr, hu, nl, br, cs, pl, ru, zh, zh-TW, it, ar, id, tr, ja, ko, uk, gr en
ALLOWED_ORIGINS Comma-separated origins for CORS and email links same-origin
FORCE_HTTPS Optional. When true: 301-redirects HTTP to HTTPS, sends HSTS, adds CSP upgrade-insecure-requests, forces the session cookie secure flag. Useful behind a TLS-terminating reverse proxy. Requires TRUST_PROXY. false
HSTS_INCLUDE_SUBDOMAINS When true: adds the includeSubDomains directive to the HSTS header, extending HTTPS enforcement to all subdomains. Only effective when HSTS is active (FORCE_HTTPS=true or NODE_ENV=production). Leave false if you run other services on sibling subdomains over plain HTTP. false
COOKIE_SECURE Controls the secure flag on the trek_session cookie. Auto-derived: on when NODE_ENV=production or FORCE_HTTPS=true. Escape hatch: set false to allow session cookies over plain HTTP. Not recommended in production. auto
SESSION_DURATION How long a login session stays valid when "Remember me" is unchecked (the default): sets the trek_session JWT exp and issues a browser-session cookie (cleared when the browser closes). Accepts ms-style strings: 1h, 12h, 7d, 30d, 90d. Invalid values warn at startup and fall back to the default. 24h
SESSION_DURATION_REMEMBER Session length when "Remember me" is ticked at login: a longer-lived JWT plus a persistent trek_session cookie that survives browser restarts. Same format and startup-fallback behaviour as SESSION_DURATION. 30d
TRUST_PROXY Number of trusted reverse proxies. Tells the server to read client IP from X-Forwarded-For and protocol from X-Forwarded-Proto. Defaults to 1 in production; off in dev unless set. 1
ALLOW_INTERNAL_NETWORK Allow outbound requests to private/RFC-1918 IPs (e.g. Immich on your LAN). Loopback and link-local addresses remain blocked. false
APP_URL Public base URL of this instance (e.g. https://trek.example.com). Required when OIDC is enabled; used as base for email notification links. โ€”
OIDC / SSO
OIDC_ISSUER OpenID Connect provider URL โ€”
OIDC_CLIENT_ID OIDC client ID โ€”
OIDC_CLIENT_SECRET OIDC client secret โ€”
OIDC_DISPLAY_NAME Label shown on the SSO login button SSO
OIDC_ONLY Force SSO-only mode: disables password login + registration, regardless of Admin > Settings. The first SSO login becomes admin. false
OIDC_ADMIN_CLAIM OIDC claim used to identify admin users โ€”
OIDC_ADMIN_VALUE Value of the OIDC claim that grants admin role โ€”
OIDC_SCOPE Space-separated OIDC scopes. Fully replaces the default โ€” always include openid email profile. openid email profile
OIDC_DISCOVERY_URL Override the auto-constructed OIDC discovery endpoint (e.g. Authentik: .../application/o/trek/.well-known/openid-configuration) โ€”
Initial setup
ADMIN_EMAIL Email for the first admin on initial boot. Must be set together with ADMIN_PASSWORD. If either is omitted a random password is printed to the server log. No effect once a user exists. [email protected]
ADMIN_PASSWORD Password for the first admin on initial boot. Pairs with ADMIN_EMAIL. random
Other
DEMO_MODE Enable demo mode (hourly data resets) false
UNSPLASH_ACCESS_KEY Optional Unsplash Access Key for trip-cover and place-image search. Without one, TREK uses Unsplash's unauthenticated endpoint, which some datacenter/VPS IPs are blocked from. Get a free key at unsplash.com/developers. Overrides any per-admin key set in Admin > Settings (where it can also be configured instead). โ€”
MCP_RATE_LIMIT Max MCP API requests per user per minute 300
MCP_MAX_SESSION_PER_USER Max concurrent MCP sessions per user. At the cap, the least-recently-active session is closed to make room 20

Data & Backups

  • Database โ€” SQLite, stored in ./data/travel.db
  • Uploads โ€” stored in ./uploads/
  • Logs โ€” ./data/logs/trek.log (auto-rotated)
  • Backups โ€” create and restore via Admin Panel
  • Auto-Backups โ€” configurable schedule and retention in Admin Panel

Data sources

The Atlas map's country and sub-national (province/county) boundaries come from
geoBoundaries (Runfola et al., 2020), licensed
CC BY 4.0. See NOTICE.md
for full third-party attributions.

License

TREK is AGPL v3. Self-host freely for personal or internal company use. If you modify and offer TREK as a network service to third parties, your modifications must be open-sourced under the same licence.

--- METRICS ---