Skip to main content
The install ships its own Postgres. To use one you manage instead, point every service at it in its file in config/, turn the bundled database off, and start. Do this on a new install: the bundled database’s data isn’t moved.

Before you begin

  • Fonoster downloaded and unpacked, but not started yet, see Install with Docker Compose.
  • A Postgres you can reach from this machine, over TLS. Every URL below ends in ?sslmode=require; keep it, or the password and your call data travel in clear. Certificate verification (sslmode=verify-full) isn’t covered here.
  • Docker Compose v2, as the install page says.

Create the databases

Create three empty databases. The API server creates the tables in fonoster and fnidentity on every start, and Routr does the same in routr:

Point every service at it

Each service takes its database URL from its file in config/, with the same credentials in all four. Replace the bundled URL in each. In config/fonoster.yaml, set the API server’s database and Identity’s identity.database:
config/fonoster.yaml
AppBridge and Autopilot share the API server’s database. Set database.url in config/appbridge.yaml and in config/autopilot.yaml:
config/appbridge.yaml
Routr has its own, under spec.database in config/routr-one.yaml:
config/routr-one.yaml
These files now hold the database password. Back them up with .env, and carry them over when you upgrade.
Set the Routr database here, not as a DATABASE_URL variable on the routr service. Since 0.35.0 that variable is ignored: Routr reads config/routr-one.yaml, and docker compose logs routr prints DATABASE_URL is ignored; spec.database.url in /etc/routr/one.yaml wins.

Turn the bundled Postgres off

The compose.external-db.yaml overlay that ships with the install keeps the bundled postgres from starting. Turn it on in .env (add :compose.http.yaml after it if you serve plain HTTP):
.env
This is what it does:
compose.external-db.yaml

Start

Start, and wait for every service to be healthy. This is what proves the database is reachable:
If routr can’t reach its database, it reports unhealthy and the command exits with an error. Fix the URL in config/routr-one.yaml and start again. A file with a bad key stops its service at start, and docker compose logs <service> names the key. See what’s running:
postgres isn’t listed, and routr shows healthy.
Every service runs against your database.
On an external Postgres, the registry tool on Add providers to the catalog needs your database URL in FONOSTER_REGISTRY_DATABASE_URL instead of the bundled one.