$selfhostrecipes.com
·9 min read

AdventureLog with Docker Compose: A Self-Hosted Travel Log and Trip Planner

How I run AdventureLog, a self-hostable travel tracker and trip planner, with Docker Compose: the three services, the URL variables that trip people up, first login, backups and upgrades.

self-hostingdocker-composepostgresqlimmichopen-source

01What AdventureLog is and why I like it

AdventureLog is an open-source (GPL-3.0) travel companion that you host yourself. You pin places you have visited on a map, group locations into collections, build multi-day itineraries, and keep notes, photos and checklists next to them. There is also a world travel view for tracking countries, regions and cities, and you can share collections with other people, either through public links or by inviting users. What appeals to me as a self-hoster is that the whole thing is one app with one database. Travel history is exactly the kind of personal data I don't want to leave in a vendor's cloud, and a trip planner that lives next to the rest of my services is easy to back up and easy to reason about. This post walks through a Docker Compose deployment based on the stack the project documents for Docker. The full recipe I'm basing this on lives at https://selfhostrecipes.com/productivity/adventurelog, and the upstream repository is https://github.com/seanmorley15/adventurelog.

02The three services you are actually running

The stack has three containers, and it helps to know what each one does before you start changing URLs. The web service is the SvelteKit frontend, the part you open in a browser. The server service is the Django backend. It provides the API and the Django admin interface, and it stores uploaded images in a named volume. The postgresql service is a PostGIS-enabled PostgreSQL database that holds everything, including the geographic data. One thing to internalize early: your browser talks to both the frontend and the backend. The frontend is published on port 8015 and the backend on port 8016 in the default setup. That is why several URL variables exist, and why most of the problems people hit come from those URLs not matching the address typed into the browser. The upstream README lists Docker Engine with Compose v2 as a requirement and mentions 2 GB of RAM on first boot, so don't try this on the smallest VPS you own. If you are planning other database-backed apps on the same host, my PostgreSQL comparison post may help with sizing decisions.

03The Compose file

Here is the Compose file, following the recipe. Every variable has a default, so it starts without a .env file, but the default passwords are placeholders and you must replace them before exposing anything. A few details worth noting. The backend waits for the database healthcheck to pass before starting, using depends_on with the service_healthy condition. The healthcheck uses a doubled dollar sign so that Compose leaves the variable for the shell inside the container to expand. The frontend maps its internal port 3000 to the host, while the backend maps its internal port 80. Two named volumes hold the database and the uploaded media. The images are referenced with the latest tag in the recipe. That is convenient, but for anything long-lived I would pin a specific release tag once I have confirmed it works for me, so upgrades happen when I decide, not when I pull.
[compose.yaml]
1services:
2 web:
3 image: ghcr.io/seanmorley15/adventurelog-frontend:latest
4 restart: unless-stopped
5 environment:
6 PUBLIC_SERVER_URL: ${PUBLIC_SERVER_URL:-http://server:8000}
7 ORIGIN: ${FRONTEND_URL:-http://localhost:8015}
8 BODY_SIZE_LIMIT: ${BODY_SIZE_LIMIT:-Infinity}
9 ports:
10 - "${FRONTEND_PORT:-8015}:3000"
11 depends_on:
12 - server
13
14 server:
15 image: ghcr.io/seanmorley15/adventurelog-backend:latest
16 restart: unless-stopped
17 environment:
18 PGHOST: postgresql
19 PGDATABASE: ${POSTGRES_DB:-database}
20 PGUSER: ${POSTGRES_USER:-adventure}
21 PGPASSWORD: ${POSTGRES_PASSWORD:-change-me}
22 SECRET_KEY: ${SECRET_KEY:-change-me-secret-key}
23 DJANGO_ADMIN_USERNAME: ${DJANGO_ADMIN_USERNAME:-admin}
24 DJANGO_ADMIN_PASSWORD: ${DJANGO_ADMIN_PASSWORD:-change-me-admin}
25 DJANGO_ADMIN_EMAIL: ${DJANGO_ADMIN_EMAIL:-admin@localhost}
26 PUBLIC_URL: ${PUBLIC_URL:-http://localhost:8016}
27 CSRF_TRUSTED_ORIGINS: ${CSRF_TRUSTED_ORIGINS:-http://localhost:8016,http://localhost:8015}
28 FRONTEND_URL: ${FRONTEND_URL:-http://localhost:8015}
29 DEBUG: ${DEBUG:-False}
30 ports:
31 - "${BACKEND_PORT:-8016}:80"
32 depends_on:
33 postgresql:
34 condition: service_healthy
35 volumes:
36 - adventurelog_media:/code/media/
37
38 postgresql:
39 image: postgis/postgis:16-3.5
40 restart: unless-stopped
41 environment:
42 POSTGRES_DB: ${POSTGRES_DB:-database}
43 POSTGRES_USER: ${POSTGRES_USER:-adventure}
44 POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-change-me}
45 healthcheck:
46 test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
47 interval: 10s
48 timeout: 5s
49 retries: 10
50 volumes:
51 - postgres_data:/var/lib/postgresql/data/
52
53volumes:
54 postgres_data:
55 adventurelog_media:
56

04Getting the URL variables right

If you only ever open AdventureLog on localhost, the defaults work. The moment you put it behind a reverse proxy with real hostnames, three variables must agree with what the browser uses: FRONTEND_URL, PUBLIC_URL and CSRF_TRUSTED_ORIGINS. PUBLIC_SERVER_URL is different. It is the address the frontend container uses to reach the backend, so on the Compose network it should stay pointed at the server service on port 8000. Because the browser talks to both halves, your proxy needs to expose both: one hostname for the frontend and one for the backend. I use two placeholder hostnames below. Replace them with your own, and generate your own passwords and secret key rather than reusing anything from a blog post. If you already run a reverse proxy, my Traefik and Caddy posts cover the routing side. The upstream project also publishes proxy guides for Nginx Proxy Manager, Traefik and Caddy.
[.env]
1FRONTEND_URL=https://travel.example.com
2PUBLIC_URL=https://travel-api.example.com
3PUBLIC_SERVER_URL=http://server:8000
4CSRF_TRUSTED_ORIGINS=https://travel.example.com,https://travel-api.example.com
5POSTGRES_DB=database
6POSTGRES_USER=adventure
7POSTGRES_PASSWORD=replace-with-a-long-random-value
8SECRET_KEY=replace-with-another-long-random-value
9DJANGO_ADMIN_USERNAME=admin
10DJANGO_ADMIN_PASSWORD=replace-with-a-third-random-value
11DJANGO_ADMIN_EMAIL=admin@example.com
12DEBUG=False
13

Do not leave POSTGRES_PASSWORD, SECRET_KEY or DJANGO_ADMIN_PASSWORD at the placeholder defaults on anything reachable by other people. Also remember that POSTGRES_PASSWORD only takes effect when the database volume is first created; changing it later will make the backend fail to connect.

05Starting it and logging in

Bring the stack up, check that all three containers are running, and watch the backend logs on the first start. The database initializes first, then the backend connects and creates the admin account from the DJANGO_ADMIN_* variables. Then open the frontend address and sign in with the admin credentials you set. With the recipe's untouched defaults that would be admin with change-me-admin, but you will have changed that. The upstream README also notes a default login of admin/admin for its own installer and recommends changing it immediately, so whichever route you take, treat the first sign-in as the moment to set a proper password. I'd also set up backups on day one. Your data lives in two named volumes: postgres_data for the database and adventurelog_media for uploaded images. Back up both.
[bash]
1docker compose up -d
2docker compose ps
3docker compose logs -f server
4

The admin user is only created the first time the backend starts. If you change DJANGO_ADMIN_PASSWORD afterwards, nothing happens; change the password from the Django admin interface instead.

06Integrations, upgrades and common problems

Once the basics work, the integrations are where AdventureLog gets interesting. The README lists Immich for linking photos from your self-hosted library, Strava and Endurain for importing activities with GPX tracks, Wanderer for attaching trails, and Google Maps for geocoding and location search. Release notes also mention that the quick-add feature for locations pulls from Google Maps, so that integration has to be enabled for quick-add to appear. If you already run Immich, the Immich post on this site is a good companion. The release notes also describe S3-compatible media storage as an option if you don't want images in a local volume. On maps: the v0.13.1 release notes say CARTO's raster basemaps now need a free API key, set through PUBLIC_CARTO_BASEMAP_API_KEY. Without one, those styles are hidden and the app uses OpenFreeMap styles by default. So a missing key is not a bug, just a smaller list of basemaps. For upgrades, the same release is flagged by the maintainer as strongly recommended because it includes security updates for the backend, frontend and container images. Back up both volumes first, then pull and recreate. Don't run docker compose down -v, because that removes the volumes and your data with them. The problems I'd check first, in order: a CSRF error on login means CSRF_TRUSTED_ORIGINS doesn't contain the exact origin you typed, including the port. Images or links pointing to the wrong address mean PUBLIC_URL or FRONTEND_URL is wrong. A frontend server error on load usually means the backend isn't running or PUBLIC_SERVER_URL no longer points at the server service on port 8000. And a backend that keeps restarting with database errors usually means the password no longer matches the one the data volume was created with.

About the Author

Frank Pegasus

Pen name of the Selfhost Recipes editors. Guides are written for people running their own services with Docker Compose and are checked against the official documentation of the tools they cover.