TREK 5.1: Self-Host a Collaborative Travel Planner with Docker Compose
TREK 5.1 is a fast-moving, AGPL-licensed travel planner with day plans, maps, shared costs, packing lists and live collaboration. We tested the Docker Compose setup on a fresh Ubuntu VM, including the two login pitfalls.
Group trips have a habit of ending up the same way: a shared spreadsheet for costs, a Google Maps list nobody could find again, flight confirmations buried in three different inboxes and a chat thread that scrolled away the one message that mattered. TREK wants to replace all of that with one app you run yourself, and judging by its GitHub activity, a lot of people like the idea.
The project only appeared on GitHub in March 2026 and already sits above 15,000 stars. Version 5.0 landed on 25 October with a pile of new features, 5.0.1 fixed the rough edges three days later, and 5.1.0 followed on 31 October. That release cadence alone is reason enough to take a closer look. I installed TREK 5.1.0 with Docker Compose on a fresh Ubuntu 24.04 VM, planned a small demo trip and wrote down what worked and what tripped me up.
What TREK is
TREK describes itself as a travel planner, but that undersells it a bit. At its core you create a trip, split it into days and drop places onto those days. Around that sits an entire ecosystem: bookings for flights, trains and hotels, shared costs with settle-up suggestions, packing lists and to-dos, files attached to a trip, a group chat with polls, and a public read-only share link for the people who just want to know where you will be on Tuesday.
Changes show up live for everyone who has the trip open, since the frontend talks to the server over a WebSocket. It is also a PWA, so you can install it on a phone straight from the browser. That part needs HTTPS, which matters for the setup below.
Under the hood it is a Node.js 24 and NestJS 11 backend with a React 19 frontend and a single SQLite database. No Postgres, no Redis, no separate worker container. For a homelab that is a pleasant surprise given how much the app does.
What is new in 5.0 and 5.1
Version 5.0 added Tours, a planner for hikes, bike rides, runs, paddle tours, horse rides, city walks and ski or winter tours, with elevation profiles and difficulty grades for hikes. It also brought TREK Studio, which turns a travel journal into a printable photo book, and an optional built-in AI assistant. External AI clients can additionally connect through TREK's MCP server, which is off by default.
Version 5.1.0 is mostly about maps. Place search, address search and routing now run on servers operated by the TREK project (sponsored by a German hosting company) instead of public services like Nominatim or the public OSRM instance. According to the release notes this makes search noticeably more accurate and faster, and lifts the old limits of 10 stops and 1,500 km per road trip day. Hebrew became the 28th language. I come back to what these hosted services mean for privacy further down.
Addons: most of it can be switched off
A lot of TREK's features are addons that an admin turns on or off. The README says Lists, Costs, Documents, Collab, Tours, Vacay and Atlas ship enabled, while Journey, Collections, MCP, the AI assistant, AI booking parsing, Road trip, Dawarich and AirTrail ship disabled. The admin panel groups things a little differently and counts a few more entries: on my fresh install it showed 8 of 16 addons enabled, and the AI section was completely off. Nothing talks to an LLM unless you configure it.

Requirements
- A Linux host with Docker Engine and the Compose plugin. The image is published for amd64 and arm64.
- About 650 MB of download and roughly 2.15 GB of disk space for the unpacked image. It is not a small image. Among other things it ships the KItinerary booking extractor and the help wiki for offline use.
- RAM: on my VM (2 vCPU, 1.8 GB RAM)
docker statsreported between 356 and 435 MiB for the idle container, before and after clicking through the demo trip. - A domain like
trek.example.comand a reverse proxy with TLS for real use. HTTPS is not optional here, as you will see in a minute.
Installing TREK 5.1.0 with Docker Compose
The repository ships a well-documented docker-compose.yml with a long list of commented options. It uses the latest tag, though. The version below is the same file trimmed down to the active settings, pinned to 5.1.0, bound to localhost and with one extra line for the first test run. This is exactly the file I tested, except for the host port.
Step 1: Create a project folder
mkdir -p ~/trek
cd ~/trekStep 2: Create docker-compose.yml
services:
app:
image: mauriceboe/trek:5.1.0
container_name: trek
read_only: true
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
cap_add:
- CHOWN
- SETUID
- SETGID
- KILL
tmpfs:
- /tmp:noexec,nosuid,size=128m
ports:
- "127.0.0.1:3000:3000"
environment:
- NODE_ENV=production
- PORT=3000
- ENCRYPTION_KEY=${ENCRYPTION_KEY:-}
- TZ=${TZ:-UTC}
- LOG_LEVEL=${LOG_LEVEL:-info}
- ALLOWED_ORIGINS=${ALLOWED_ORIGINS:-}
- COOKIE_SECURE=false # only while testing over plain HTTP, remove behind HTTPS
volumes:
- ./data:/app/data
- ./uploads:/app/uploads
restart: unless-stopped
logging:
driver: json-file
options:
max-size: 10m
max-file: "3"
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:$${PORT:-3000}/api/health || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 15sThe hardening block comes straight from upstream: a read-only root filesystem, all capabilities dropped except three that the entrypoint needs to hand off to the unprivileged node user (CHOWN, SETUID, SETGID) plus KILL, which lets dumb-init forward the stop signal so TREK can shut down cleanly, and an in-memory /tmp. Only ./data (SQLite database, logs, keys, backups) and ./uploads (photos, documents, covers) are writable. You do not need to create those folders first. On my VM they were created on the first start, and the files in ./data ended up owned by UID 1000 without any manual chown.
The COOKIE_SECURE=false line is my addition, and it is only there for the first look before the reverse proxy exists. Step 6 removes it again.
Step 3: Create the .env file
The compose file reads four values from .env. Only those that are referenced with ${...} in the environment: block reach the container, so putting other variables into .env does nothing.
cat > .env <<EOF
ENCRYPTION_KEY=$(openssl rand -hex 32)
TZ=Europe/Berlin
ALLOWED_ORIGINS=https://trek.example.com,http://localhost:3000
EOF
chmod 600 .envENCRYPTION_KEY encrypts stored secrets like API keys, OIDC client secrets and 2FA seeds. If you leave it empty, TREK generates one and writes it to data/.encryption_key, but setting it yourself means you know where it is. Keep a copy of this file somewhere safe, for a reason I explain in the backup section.
The first entry in ALLOWED_ORIGINS also becomes the app's public URL (used for OIDC redirects, passkeys and links in emails), which is why the real domain goes first. The second entry is for the SSH tunnel in step 5.
Step 4: Start TREK
docker compose up -d
docker compose psOn my VM the image pull plus first start took about a minute. Once the container was running, the app needed roughly ten seconds to apply its 329 database migrations and report itself healthy. A quick check from the host:
curl -s http://127.0.0.1:3000/api/healthThat should return {"status":"ok"}.
On the first boot of an empty database TREK creates an admin account. Without ADMIN_EMAIL and ADMIN_PASSWORD set, the email is admin@trek.local and the password is random. It is printed exactly once, in a box in the log:
docker compose logs | grep -A6 "First Run"Step 5: First login through an SSH tunnel
Because the port is bound to 127.0.0.1, you cannot reach it from your laptop directly. An SSH tunnel is the quickest way to have a look before the proxy is in place:
ssh -L 3000:localhost:3000 you@your-serverThen open http://localhost:3000 in your browser and sign in with the credentials from the log. TREK immediately asks you to set a new password before anything else. In my test that worked as described, and after the password change I landed on the dashboard, greeted by a large "what's new in 5.1.0" pop-up from the maintainer that you can close.
Two stumbling blocks I hit
Both are documented, but I still walked into them.
"Not allowed by CORS". My first attempt only had https://trek.example.com in ALLOWED_ORIGINS. The login request from http://localhost:3000 was refused with HTTP 403, and the log said "CORS: refused origin ... add it to ALLOWED_ORIGINS if it is yours". Adding the tunnel origin to the list fixed it in my setup, so if you set ALLOWED_ORIGINS at all, include every address you actually type into the browser.
Login that does not stick. With NODE_ENV=production, TREK marks its session cookie as secure, and the browser then drops it over plain HTTP. The server logged a successful login, but I was bounced straight back to the login page. To its credit, TREK shows a clear warning box on the login screen explaining exactly this and pointing to COOKIE_SECURE=false. That is why the line exists in the compose file above, and why it has to go once HTTPS is in place.
Step 6: Put it behind HTTPS
For real use, put a TLS-terminating reverse proxy in front of TREK. With Caddy running on the same host, the upstream README needs only this, since Caddy handles certificates and WebSockets on its own:
trek.example.com {
reverse_proxy localhost:3000
}If you use Nginx instead, the proxy has to pass WebSocket upgrades on /ws. The README has a complete Nginx example.
Then switch TREK to production mode properly:
- Delete the
COOKIE_SECURE=falseline fromdocker-compose.yml. - Add
- FORCE_HTTPS=trueand- TRUST_PROXY=1to theenvironment:list, as the comments in the official compose file suggest for setups behind a TLS proxy.TRUST_PROXY=1assumes exactly one proxy in front of TREK. - Remove
http://localhost:3000fromALLOWED_ORIGINSin.env, so it only containshttps://trek.example.com. - Apply the change with
docker compose up -d.
To be transparent: the tunnel setup above is what I actually ran. The HTTPS step follows the official documentation, but I did not test it with a real certificate on the test VM.
Planning a trip

Creating a trip takes a title, optional dates or simply a number of days, a currency and an optional reminder. I made a four-day "Lisbon Long Weekend" without dates. Inside the trip you get tabs for Plan, Tours, Transports, Bookings, Lists, Costs, Files and Collab.
In the Plan view, Add Place/Activity opens a dialog with a search field. Results come from TREK's own place index and from OpenStreetMap, and each result is labelled with its source. Picking one fills in the address and coordinates, and for well-known sights TREK also pulled in a photo, which is where the thumbnails in the screenshot above come from. To put places on a day, you select the day and click the small + next to a place in the right-hand column, or drag it over.
One thing to watch: the first search result is not always the place you mean. Searching for "Castelo de São Jorge Lisbon" gave me a serviced apartment named after the castle as the first hit, and "LX Factory Lisbon" returned a luggage storage business. Searching for just "Castelo de São Jorge" put the castle first. The index is strong on businesses, so read the result before clicking.
The dashboard also has small widgets for currency conversion and time zones, and the top navigation includes Vacay, a leave calendar with public and school holidays, and Atlas, a map of countries you have visited.
Tips
- Pin the version. Upstream offers full version tags (
5.1.0), minor tags (5.1), major tags (5) andlatest. With a full tag you update by editing the tag and runningdocker compose up -d. The 5.0 release notes also point out that TREK makes a copy of the database before an update migrates it, so leave enough free disk space for that copy. - Back up the key separately. TREK has a backup tab in the admin panel (database, uploads and plugin data as a ZIP, manual or scheduled). If you set
ENCRYPTION_KEYthrough the environment, as above, the key is not included in that ZIP. Without the key, stored secrets in a restored backup are useless, so back up.envas well. - SSO and 2FA. TREK supports one OIDC provider, passkeys and TOTP. If you already run an identity provider such as Pocket ID, set the
OIDC_*variables documented in the compose file.APP_URLis only needed if your public URL differs from the first entry inALLOWED_ORIGINS. - Notifications. Among the notification channels the README lists email, webhooks, Web Push and ntfy.
- Read the first-run log right away. The random admin password appears only on the very first start. If you miss it and add
ADMIN_EMAIL/ADMIN_PASSWORDlater, they are ignored because a user already exists. The troubleshooting wiki explains how to reset the admin in that case.
Limits and security
It is not fully offline by default. This is the part I would want to know before installing. By default, place search asks the TREK Places API at places.liketrek.com, and address search and routing are handled by TREK's own Photon and Valhalla servers unless you configure your own Nominatim or pick another routing service in the admin settings. The installation registers its own key with these services in the background on first use. According to the docs, only the number of requests is counted and searches are not logged, but they do leave your server. Other features use public services as well: weather comes from Open-Meteo, exchange rates from Frankfurter, and on my install the map tiles came from OpenFreeMap. TREK_SERVICES=off stops the installation from using its own key, and TREK_PLACES_ENABLED=false turns off the place index, so search works the way it did before 4.3.0 (OpenStreetMap, or Google or Amap if you add a key). Either way, searches still go to some external service. Sharing place details that your users type in with the TREK community is a separate opt-in and stays off until an admin agrees.
HTTPS is effectively required. Secure cookies, passkeys and the PWA install all depend on it. Running TREK permanently over plain HTTP with COOKIE_SECURE=false is something the docs only accept for internal home-lab setups, never for a public instance.
Big feature surface. A plugin system with third-party code, an MCP server with OAuth, an AI assistant with your own API keys: all optional, but all of it is attack surface once enabled. The plugin system runs each plugin in its own child process with granted permissions, and TREK_PLUGINS_ENABLED=false turns it off entirely. My advice is to enable what you actually use and leave the rest alone.
Young project, fast pace. Three releases in one week are great when you are waiting for a fix, less great when you want a quiet server. The 4.3.4 release from 21 October was purely a rebuild for the Node.js security fixes, and the maintainer asked users to update as soon as possible. Watch the releases page.
License. TREK uses the AGPL-3.0, an OSI-approved copyleft license. Running it at home or inside your company is fine. The copyleft part only kicks in when you change the code and let other people use your modified version over the network: then they are entitled to your source code under the same terms.
TREK compared to alternatives
AdventureLog (GPL-3.0) is the closest self-hosted relative. It describes itself as a travel tracker and trip planner, so it covers similar ground. I have not tested it for this article, but if your main interest is keeping a record of past trips, it is worth comparing. TREK's strengths are group planning, shared costs, bookings and live collaboration.
wanderer (AGPL-3.0) is a self-hosted trail database for hikes and outdoor routes. It overlaps with TREK's new Tours addon, and the two can actually work together: TREK can import trails from a wanderer instance. Dawarich (AGPL-3.0) is a Google Timeline replacement that records where you actually went, and TREK has an optional addon to pull recorded tracks from it.
Compared with hosted planners like Wanderlog or TripIt, the trade-off is the usual one. You get your data in a SQLite file on your own disk, but you are the one doing updates and backups.
Conclusion
For a project that is barely eight months old, TREK is remarkably polished: a very complete tool with sensible container hardening, a single-container setup and good documentation, including helpful warnings right in the UI when something is misconfigured. On a small VM it ran comfortably below half a gigabyte of RAM.
The two things to keep in mind are HTTPS, which you really need, and the map services: by default searches and routing go to the TREK project's servers, and even with those switched off they go to other public map services. If you plan trips with friends or family and are tired of spreadsheets and scattered links, TREK 5.1 is well worth an evening.
Sources
- TREK on GitHub (liketrek/TREK)
- TREK v5.1.0 release notes
- TREK v5.0.0 release notes
- TREK v4.3.4 release notes
- Official docker-compose.yml at v5.1.0
- TREK license (AGPL-3.0)
- TREK wiki: Install with Docker Compose
- TREK wiki: Quick Start
- TREK wiki: Environment Variables
- TREK wiki: Troubleshooting
- TREK wiki: TREK Places API
- TREK wiki: Backups
- TREK wiki: Updating
- mauriceboe/trek on Docker Hub
- findarepo: self-hosted GitHub projects ranked by star growth
- AdventureLog on GitHub
- wanderer on GitHub
- Dawarich on GitHub