travstats-db postgis/postgis:15-3.4 https://hub.docker.com/r/postgis/postgis bridge sh false https://forums.unraid.net/topic/198320-support-travstats-self-hosted-flight-tracker/ https://github.com/postgis/docker-postgis PostgreSQL 15 with the PostGIS 3.4 spatial extension — the database TravStats expects. This template is pre-filled with the container name `travstats-db` and the database/user pair `flights/flights` so the default `DATABASE_URL` in the TravStats template matches without further editing. **Change the password to a strong value** (e.g. `openssl rand -base64 32`) and reuse it in TravStats. **Install order:** this container **first**, then the TravStats template. The database is published on the Unraid host at port 5432 (adjustable below) so TravStats can reach it via `host.docker.internal:5432` without needing a shared Docker network. Keep the port free of conflicts with other PostgreSQL containers you may already run. **Storage:** the default Application Data path (`/mnt/user/appdata/travstats-db`) maps to PostgreSQL's data directory. The actual cluster lives in a `pgdata/` subdirectory (see the `PGDATA` variable below) — this is the officially recommended layout from the `postgres` Docker image and avoids a well-known Unraid permission issue where `chown` from inside the container can't reach the FUSE-backed share root. The initial cluster is created on first start and then kept in place on updates; deleting the `pgdata/` subdirectory wipes the database, so point your backup tool at this folder. **Why PostGIS, not plain Postgres?** TravStats uses PostGIS for airport and route geometry. Plain `postgres:15` fails the first TravStats migration. --- **Troubleshooting — "FATAL: could not open file global/pg_filenode.map: Permission denied"** If you see this error in the container log and TravStats shows "Error querying the database" on its setup page, your `pgdata/` directory was created under the wrong UID by a previous (broken) install. Fix: 1. Stop both containers (`TravStats`, `travstats-db`). 2. On the Unraid console: `rm -rf /mnt/user/appdata/travstats-db/pgdata` *(or whichever Application Data path you chose)*. 3. Start `travstats-db` — it now re-runs `initdb` with the correct UID (999, the Postgres user inside the image). 4. Start `TravStats` — setup page should load without errors. If the fresh start still fails on `/mnt/user/...`, switch the Application Data path to `/mnt/cache/appdata/travstats-db` (direct cache-pool mount, bypasses Unraid's FUSE layer) and repeat step 3. Requires a cache pool to be configured. Tools:Utilities Other: https://raw.githubusercontent.com/Abrechen2/docker-templates/main/my-travstats-db.xml https://raw.githubusercontent.com/Abrechen2/docker-templates/main/icon-travstats-db.svg --restart=unless-stopped Used together with the TravStats Community Apps template. /mnt/user/appdata/travstats-db /var/lib/postgresql/data/pgdata flights flights CHANGEME 5432 UTC