# pgautoupgrade/docker-pgautoupgrade

A PostgreSQL Docker container that automatically upgrades your database

Repository: https://github.com/pgautoupgrade/docker-pgautoupgrade
Canonical: https://ross.abutalabs.com/products/docker-pgautoupgrade
Homepage: https://hub.docker.com/r/pgautoupgrade/pgautoupgrade
Language: Shell
License: MIT
License Family: permissive
Topics: docker, postgres, postgresql, postgresql-database, upgrade
Last push: 2026-09-02T06:45:54+00:00

## Health v2 (maintenance only)
Score: 74/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 100, release rhythm 35, longevity 82
- inputs: {"age_days": 1152, "days_push": 0, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1184, forks 32 (observed 2026-09-03T02:15:16.838135+00:00)

## What it is
A PostgreSQL Docker image that automatically detects the version of an existing database data directory and upgrades it in place using pg_upgrade before starting the server. It supports PostgreSQL 9.5 through the latest versions, with Alpine and Debian-based image variants and an optional one-shot upgrade mode.

## Use cases
- automatically upgrade postgresql docker container to a new major version
- upgrade postgres data directory without manual pg_upgrade steps
- replace official postgres docker image with one that handles version upgrades
- run a one-shot in-place postgres upgrade in docker
- migrate postgres 9.5+ database files to postgres 17 or 18 in a container
- avoid manual dump and restore when upgrading postgresql in docker

## When to choose
- you run PostgreSQL in Docker and want seamless major version upgrades on container start
- you want to avoid manual pg_upgrade or dump/restore procedures
- you need both Alpine and Debian-based image options to match your existing setup
- you want a one-shot upgrade without keeping the server running

## When to avoid
- you need guaranteed safety without backups - in-place upgrades can fail and destroy data
- you rely on custom healthchecks that are incompatible with this image
- you are not using Docker or containerized PostgreSQL
- you need to upgrade across unsupported version gaps or non-standard data directory layouts

## Facets
- artifact type: application
- maturity: active
- function: database, deployment, developer-tools
- domain: databases, self-hosted
- platform: self-hosted
- tags: postgresql, pg-upgrade, docker-image, database-migration, version-upgrade, devops, containers, docker, linux

## Member repositories
- pgautoupgrade/docker-pgautoupgrade (main) score 74

## Provenance
- Observed fields: from GitHub, fetched 2026-09-03T02:15:16.838135+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:24:52.282772+00:00, confidence not recorded.
  - readme: https://github.com/pgautoupgrade/docker-pgautoupgrade (fetched 2026-09-03T02:15:16.838135+00:00, sha a01560f76cbd)
  - homepage: https://hub.docker.com/r/pgautoupgrade/pgautoupgrade (fetched 2026-08-29T12:31:46.861698+00:00, sha 90b40e3a9125)
  - site_page: https://docs.docker.com/docker-hub (fetched 2026-08-29T12:31:46.865605+00:00, sha caaa18892709)
  - site_page: https://www.docker.com/docs (fetched 2026-08-29T12:31:46.867724+00:00, sha aeada2272712)
  - site_page: https://www.docker.com/company (fetched 2026-08-29T12:31:46.869809+00:00, sha 05ab59b2bc29)
- Data as of 2026-08-30T08:39:29.467469+00:00.
