$selfhostrecipes.com

AdventureLog: Self-Hosted Travel Log and Trip Planner

intermediate

Run AdventureLog, a self-hosted travel tracker and trip planner, with its SvelteKit frontend, Django backend and a PostGIS database.

Share

[i]Overview

AdventureLog is an open-source, GPL-3.0 licensed travel companion that lets you log places you have visited, plan future trips and keep notes, photos and locations in one place that you host yourself. Locations are shown on a map, and you can group them into collections and share them with other people. This recipe runs the three services the project documents for Docker. The web service is the SvelteKit frontend that you open in the browser. The server service is the Django backend, which provides the API and the admin interface and stores uploaded images in a named volume. The postgresql service is a PostGIS-enabled PostgreSQL database that holds all of your data, including geographic information. The stack starts without a .env file. Every variable has a default, and the default passwords are placeholders that you must change before you expose anything. The frontend is published on port 8015 and the backend on port 8016. Your browser talks to both, so the URL variables must match the address you use to reach them.

[*]Key Features

  • [+]Log visited and planned locations on an interactive map
  • [+]Group locations into collections and itineraries for trips
  • [+]Attach notes, links and images to locations
  • [+]Share collections with other users on the same instance
  • [+]Django admin interface for managing users and data
  • [+]Creates the first admin account from environment variables on startup
  • [+]PostGIS-backed PostgreSQL storage for location data
  • [+]Uploaded media kept in a named volume

[#]Common Use Cases

  • [1]Keep a personal record of every country and city you have visited
  • [2]Plan a multi-stop road trip with notes for each stop
  • [3]Share a trip collection with friends or family travelling together
  • [4]Replace a hosted travel-journal service with data you control
  • [5]Run a private travel log for a small group on a home server

[!]Prerequisites

  • [!]Docker Engine with the Compose plugin installed
  • [!]Ports 8015 and 8016 free on the host
  • [!]At least 1 GB of free RAM for the three containers
  • [!]A browser that can reach both the frontend and backend ports
  • [!]Willingness to edit the URL variables if you serve it from another hostname
[!]

WARNING: For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

[$]docker-compose.yml

[docker-compose.yml]
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

[$].env Template

[.env]
1# All values are optional; defaults are built into the compose file.
2FRONTEND_PORT=8015
3BACKEND_PORT=8016
4FRONTEND_URL=http://localhost:8015
5PUBLIC_URL=http://localhost:8016
6PUBLIC_SERVER_URL=http://server:8000
7CSRF_TRUSTED_ORIGINS=http://localhost:8016,http://localhost:8015
8POSTGRES_DB=database
9POSTGRES_USER=adventure
10POSTGRES_PASSWORD=change-me
11SECRET_KEY=change-me-secret-key
12DJANGO_ADMIN_USERNAME=admin
13DJANGO_ADMIN_PASSWORD=change-me-admin
14DJANGO_ADMIN_EMAIL=admin@localhost
15DEBUG=False
16

[i]Usage Notes

  1. [1]First login: open http://localhost:8015 and sign in with the admin account created on first start (username admin, password change-me-admin unless you set DJANGO_ADMIN_USERNAME and DJANGO_ADMIN_PASSWORD).
  2. [2]Change POSTGRES_PASSWORD, SECRET_KEY and DJANGO_ADMIN_PASSWORD before exposing the service to anyone else.
  3. [3]The frontend is on http://localhost:8015 and the backend API and admin interface are on http://localhost:8016.
  4. [4]If you serve AdventureLog from another hostname or port, update FRONTEND_URL, PUBLIC_URL and CSRF_TRUSTED_ORIGINS to match what the browser uses.
  5. [5]The admin user is only created the first time the backend starts; later changes to the DJANGO_ADMIN_* variables do not alter it.
  6. [6]Data lives in the postgres_data and adventurelog_media named volumes; back both up before upgrading the images.

Individual Services(3 services)

Copy individual services to mix and match with your existing compose files.

web
web:
  image: ghcr.io/seanmorley15/adventurelog-frontend:latest
  restart: unless-stopped
  environment:
    PUBLIC_SERVER_URL: ${PUBLIC_SERVER_URL:-http://server:8000}
    ORIGIN: ${FRONTEND_URL:-http://localhost:8015}
    BODY_SIZE_LIMIT: ${BODY_SIZE_LIMIT:-Infinity}
  ports:
    - ${FRONTEND_PORT:-8015}:3000
  depends_on:
    - server
server
server:
  image: ghcr.io/seanmorley15/adventurelog-backend:latest
  restart: unless-stopped
  environment:
    PGHOST: postgresql
    PGDATABASE: ${POSTGRES_DB:-database}
    PGUSER: ${POSTGRES_USER:-adventure}
    PGPASSWORD: ${POSTGRES_PASSWORD:-change-me}
    SECRET_KEY: ${SECRET_KEY:-change-me-secret-key}
    DJANGO_ADMIN_USERNAME: ${DJANGO_ADMIN_USERNAME:-admin}
    DJANGO_ADMIN_PASSWORD: ${DJANGO_ADMIN_PASSWORD:-change-me-admin}
    DJANGO_ADMIN_EMAIL: ${DJANGO_ADMIN_EMAIL:-admin@localhost}
    PUBLIC_URL: ${PUBLIC_URL:-http://localhost:8016}
    CSRF_TRUSTED_ORIGINS: ${CSRF_TRUSTED_ORIGINS:-http://localhost:8016,http://localhost:8015}
    FRONTEND_URL: ${FRONTEND_URL:-http://localhost:8015}
    DEBUG: ${DEBUG:-False}
  ports:
    - ${BACKEND_PORT:-8016}:80
  depends_on:
    postgresql:
      condition: service_healthy
  volumes:
    - adventurelog_media:/code/media/
postgresql
postgresql:
  image: postgis/postgis:16-3.5
  restart: unless-stopped
  environment:
    POSTGRES_DB: ${POSTGRES_DB:-database}
    POSTGRES_USER: ${POSTGRES_USER:-adventure}
    POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-change-me}
  healthcheck:
    test:
      - CMD-SHELL
      - pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}
    interval: 10s
    timeout: 5s
    retries: 10
  volumes:
    - postgres_data:/var/lib/postgresql/data/

[>]Quick Start

[terminal]
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 web:
5 image: ghcr.io/seanmorley15/adventurelog-frontend:latest
6 restart: unless-stopped
7 environment:
8 PUBLIC_SERVER_URL: ${PUBLIC_SERVER_URL:-http://server:8000}
9 ORIGIN: ${FRONTEND_URL:-http://localhost:8015}
10 BODY_SIZE_LIMIT: ${BODY_SIZE_LIMIT:-Infinity}
11 ports:
12 - "${FRONTEND_PORT:-8015}:3000"
13 depends_on:
14 - server
15
16 server:
17 image: ghcr.io/seanmorley15/adventurelog-backend:latest
18 restart: unless-stopped
19 environment:
20 PGHOST: postgresql
21 PGDATABASE: ${POSTGRES_DB:-database}
22 PGUSER: ${POSTGRES_USER:-adventure}
23 PGPASSWORD: ${POSTGRES_PASSWORD:-change-me}
24 SECRET_KEY: ${SECRET_KEY:-change-me-secret-key}
25 DJANGO_ADMIN_USERNAME: ${DJANGO_ADMIN_USERNAME:-admin}
26 DJANGO_ADMIN_PASSWORD: ${DJANGO_ADMIN_PASSWORD:-change-me-admin}
27 DJANGO_ADMIN_EMAIL: ${DJANGO_ADMIN_EMAIL:-admin@localhost}
28 PUBLIC_URL: ${PUBLIC_URL:-http://localhost:8016}
29 CSRF_TRUSTED_ORIGINS: ${CSRF_TRUSTED_ORIGINS:-http://localhost:8016,http://localhost:8015}
30 FRONTEND_URL: ${FRONTEND_URL:-http://localhost:8015}
31 DEBUG: ${DEBUG:-False}
32 ports:
33 - "${BACKEND_PORT:-8016}:80"
34 depends_on:
35 postgresql:
36 condition: service_healthy
37 volumes:
38 - adventurelog_media:/code/media/
39
40 postgresql:
41 image: postgis/postgis:16-3.5
42 restart: unless-stopped
43 environment:
44 POSTGRES_DB: ${POSTGRES_DB:-database}
45 POSTGRES_USER: ${POSTGRES_USER:-adventure}
46 POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-change-me}
47 healthcheck:
48 test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
49 interval: 10s
50 timeout: 5s
51 retries: 10
52 volumes:
53 - postgres_data:/var/lib/postgresql/data/
54
55volumes:
56 postgres_data:
57 adventurelog_media:
58
59EOF
60
61# 2. Create the .env file
62cat > .env << 'EOF'
63# All values are optional; defaults are built into the compose file.
64FRONTEND_PORT=8015
65BACKEND_PORT=8016
66FRONTEND_URL=http://localhost:8015
67PUBLIC_URL=http://localhost:8016
68PUBLIC_SERVER_URL=http://server:8000
69CSRF_TRUSTED_ORIGINS=http://localhost:8016,http://localhost:8015
70POSTGRES_DB=database
71POSTGRES_USER=adventure
72POSTGRES_PASSWORD=change-me
73SECRET_KEY=change-me-secret-key
74DJANGO_ADMIN_USERNAME=admin
75DJANGO_ADMIN_PASSWORD=change-me-admin
76DJANGO_ADMIN_EMAIL=admin@localhost
77DEBUG=False
78
79EOF
80
81# 3. Start the services
82docker compose up -d
83
84# 4. View logs
85docker compose logs -f

[>]One-Liner

Run this command to download and set up the recipe in one step:

[terminal]
1curl -fsSL https://selfhostrecipes.com/api/recipes/adventurelog/run | bash

[?]Troubleshooting

  • [!]Login or form submissions fail with a CSRF error: make sure CSRF_TRUSTED_ORIGINS contains the exact origin you type in the browser, including the port.
  • [!]Images or links point to the wrong address: set PUBLIC_URL and FRONTEND_URL to the addresses you actually use to reach the backend and frontend.
  • [!]Backend keeps restarting with database errors: confirm POSTGRES_PASSWORD matches what the data volume was first created with; if you changed it later, remove the postgres_data volume (this deletes data) or change the password inside PostgreSQL.
  • [!]Frontend shows a server error on load: check that the server container is running with docker compose logs server, and that PUBLIC_SERVER_URL still points to the server service on port 8000.
  • [!]Cannot log in as admin after changing DJANGO_ADMIN_PASSWORD: the admin user is only created on first start, so change the password in the Django admin interface instead.
  • [!]Uploaded images disappear after recreating containers: keep the adventurelog_media volume and do not run docker compose down -v.

Community Notes

Loading...
Loading notes...

## Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license