Dokku docs: https://dokku.com/docs/community/plugins/#official-plugins-beta
Module: src/modules/postgres.ts
Declare Postgres service instances. Services are created before apps during up, so they are ready to be linked.
postgres:
api-db: # service name
version: "17-3.5" # optional: image version
image: postgis/postgis # optional: custom Docker image
other-db: {} # defaults: standard postgres image, latest version| Key | Dokku Flag |
|---|---|
version |
postgres:create <name> --image-version <version> |
image |
postgres:create <name> --image <image> |
Service creation is idempotent — if the service already exists, it is skipped.
Configure S3-compatible automated backups for a Postgres service. Backup configuration is applied idempotently using a content hash — it only re-runs when the config changes.
postgres:
api-db:
version: "17-3.5"
backup:
schedule: "0 * * * *" # cron schedule
bucket: "db-backups/api-db" # S3 bucket/path
auth:
access_key_id: "${R2_ACCESS_KEY_ID}"
secret_access_key: "${R2_SECRET_ACCESS_KEY}"
region: "auto"
signature_version: "s3v4"
endpoint: "${R2_SCHEME}://${R2_HOST}"| Key | Dokku Command |
|---|---|
backup.auth.* |
postgres:backup-auth <name> <key> <secret> <region> <sig_version> <endpoint> |
backup.schedule + backup.bucket |
postgres:backup-schedule <name> <schedule> <bucket> |
All backup.auth fields are required when backup is configured.
dokku-compose export discovers Postgres services by querying postgres:list and postgres:info on the server. Custom images (e.g., postgis/postgis) are included when they differ from the default postgres image.