You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
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.
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.
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):
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.
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
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.
admin@trek.local
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
MCP_RATE_LIMIT
Max MCP API requests per user per minute
300
MCP_MAX_SESSION_PER_USER
Max concurrent MCP sessions per user
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.
About
A self-hosted travel/trip planner with real-time collaboration, interactive maps, PWA support, SSO, budgets, packing lists, and more.