Configuration

ManyLayers uses PostgreSQL as its database. Set your connection URL in gateway.yaml:
database:
  url: ${MANYLAYERS_POSTGRES_URL}
  # Example: postgres://user:pass@host:5432/manylayers?sslmode=require
For production, use a strong password and require TLS:
database:
  url: postgres://user:${POSTGRES_PASSWORD}@db.internal:5432/manylayers?sslmode=require
The database section is restart-only. Changing the connection URL requires a gateway restart — it cannot be updated through the admin UI.

Migrations

Database migrations run automatically each time the gateway starts. ManyLayers applies all pending migrations before accepting traffic. If a migration fails, the gateway exits with an error rather than starting in a partially migrated state. For rolling upgrades or when you want to run migrations before restarting the gateway:
# Docker Compose
docker compose --env-file infra/docker/.env.prod -f infra/docker/infra/docker/docker-compose.prod.yml run --rm migrate

# Helm (runs as a pre-upgrade hook automatically)
helm upgrade manylayers manylayers-<version>.tgz --namespace manylayers

Backup and restore

Use standard PostgreSQL tools to back up and restore your database:
# Backup
pg_dump postgres://user:pass@host:5432/manylayers > manylayers-backup.sql

# Restore
psql postgres://user:pass@host:5432/manylayers < manylayers-backup.sql
Schedule automated backups using your Postgres provider’s backup service or pg_dump in a cron job.