Skip to content

Install with an AI agent

If you already use an AI coding agent (Claude Code, Codex, Gemini CLI, …), it can do the installation for you. Copy the prompt below into the agent, run the agent on your server or give it SSH access the way you normally would, and tell it:

  • which server to use and where to install TravStats,
  • whether you open TravStats only on your network over HTTP, on a private network such as Tailscale, or through a public domain,
  • whether you want to use the Companion app away from home — that needs an HTTPS address the phone can reach; plain HTTP only works on your own network.

The prompt does not contain installation steps of its own. It sends the agent to the current pages of this documentation first, so it stays correct when TravStats changes.

What the agent does — and what it leaves to you

Section titled “What the agent does — and what it leaves to you”
  • It checks the host, installs Docker if it is missing, downloads the official docker-compose.prod.yml, writes a .env file with a generated database password, starts the stack and verifies that /health returns 200.
  • It keeps any existing installation, its secrets and volumes, and takes a database dump before an upgrade. It is told never to delete volumes.
  • It asks before keeping the bundled Ollama container on a host with less than about 12 GB of RAM.
  • It does not complete the setup wizard or create an admin from the command line. There is no default admin account; you create it in the browser, so the password never passes through the agent or its chat log.
  • It does not print secret values; it only tells you where the .env file is.
Install a self-hosted TravStats instance on my server using Docker Compose.
Read the current official documentation before making changes:
- https://travstats.de/docs/getting-started/installation/
- https://travstats.de/docs/getting-started/first-run/
- https://travstats.de/docs/getting-started/updating/
- https://travstats.de/docs/operations/backups/
- https://travstats.de/docs/operations/reverse-proxy/
1. Establish the target server, the installation directory and the intended
access URL from the context I provide: LAN only over HTTP, private network
(for example Tailscale), or a public domain. Ask for any missing details.
If I want to use the TravStats Companion app away from home, the server
needs an HTTPS address the phone can reach. Check the OS, CPU
architecture, memory, free disk space, Docker, Docker Compose and whether
port 3000 is free. Install missing prerequisites using the official
Docker instructions for that OS.
2. Check for an existing TravStats installation (containers named
travstats-*, volumes travstats-db-data / travstats-app-data) before
creating or changing anything. Preserve existing configuration, secrets
and volumes. For an upgrade, follow the updating guide and take the
pre-upgrade database dump it describes first. Never delete volumes, and
never run `docker compose down -v`, `docker volume rm` or
`docker system prune` to fix an installation.
3. For a new installation, download the official production Compose file
into the installation directory:
https://raw.githubusercontent.com/Abrechen2/TravStats/main/docker-compose.prod.yml
Use it unchanged as the starting point.
4. Generate a strong `DB_PASSWORD` and write it to a `.env` file with mode
600 next to the compose file. Never print a secret value in the chat.
- The bundled Ollama container needs about 8–10 GB of RAM. If the host
has less than about 12 GB in total, ask me whether to remove the
ollama service or point `OLLAMA_URL` at another machine, as the
installation guide describes.
- LAN over plain HTTP: set `COOKIE_SECURE=false`, otherwise sign-in
loops.
- Public domain: configure HTTPS following the reverse-proxy guide and
make sure `Host` and `X-Forwarded-Proto` reach the app.
- Keep the database and Ollama on the internal Docker network; only the
app port may be published.
5. Validate with `docker compose -f docker-compose.prod.yml config --quiet`,
then `pull` and `up -d`. The first start applies migrations and seeds
about 9,000 airports; allow a few minutes.
6. Check `docker compose ps`, the app logs (wait for
`[entrypoint] TravStats is ready`) and `curl -fsS http://<host>:3000/health`.
Open the access URL and confirm the setup wizard appears. Diagnose and
fix startup errors before declaring success. State explicitly if a check
could not be completed.
7. There is no default admin account. Do not complete the setup wizard and
do not create an admin from the command line; I create the admin account
in the browser. Report: the installation directory, the access URL,
service status, whether Ollama is running, the location of the `.env`
file (not its contents), and the commands to stop, start, update and back
up this instance. Remind me that automatic backups are off until I enable
them under Admin → Backups, and that `/app/data/secrets/` (the encryption
key) must be backed up separately.

Open the URL it reports and continue with the first-run wizard. Then switch on backups — they are off on a fresh instance.