// Bitnami alternatives / postgresql

Bitnami PostgreSQL alternative
Replacing bitnamilegacy/postgresql

The bitnamilegacy/postgresql image has had about 17.5 million pulls since Bitnami moved it to the legacy repository, and it receives no updates. Switching to the official postgres image means changing environment variables and the data path. Get either wrong and the new container starts empty.

Trusted globally by enterprises

Henry ScheinEnbridgeGojekMicrosoft

Bitnami PostgreSQL variables and their official equivalents

Bitnami PostgreSQL image to official postgres:

SettingBitnamiOfficial image
Superuser or app userPOSTGRESQL_USERNAMEPOSTGRES_USER
PasswordPOSTGRESQL_PASSWORDPOSTGRES_PASSWORD
DatabasePOSTGRESQL_DATABASEPOSTGRES_DB
Empty password in developmentALLOW_EMPTY_PASSWORDPOSTGRES_HOST_AUTH_METHOD=trust
Data path/bitnami/postgresql/var/lib/postgresql (PGDATA)

What breaks when you switch

  • The volume is mounted at /bitnami/postgresql. The official image looks under /var/lib/postgresql, so an unchanged volume mount starts an empty database.
  • Bitnami's replication variables (POSTGRESQL_REPLICATION_*) have no official equivalent; replication has to be configured explicitly or handed to an operator.
  • The Bitnami image runs as a non-root user. Check ownership of existing volumes before switching users.

bitnami/postgresql Helm chart values the drop-in image reads

The bitnami/postgresql chart passes credentials under the POSTGRES_* names, which the Bitnami image accepts as aliases for its own POSTGRESQL_* variables. The official postgres image uses the same names with a different meaning. There, POSTGRES_USER becomes the superuser. On the Bitnami image it creates an extra user, postgres stays the superuser, and the chart sends that password separately as POSTGRES_POSTGRES_PASSWORD. The OSSeva image keeps the Bitnami meaning, which is what the chart was written for. Chart 11.0.0 regrouped the older flat values (postgresqlUsername, postgresqlPassword, postgresqlDatabase, replication.enabled) under auth and architecture; both layouts render the variables below. Checked against chart 10.16.3 (PostgreSQL 11) and 11.9.13 (PostgreSQL 14).

Chart valueWhat the chart passes to the container
auth.postgresPasswordPOSTGRES_POSTGRES_PASSWORD when auth.username is set, otherwise POSTGRES_PASSWORD
auth.username, auth.passwordPOSTGRES_USER, POSTGRES_PASSWORD
auth.databasePOSTGRES_DB
auth.usePasswordFilesThe matching *_FILE variables, pointing at /opt/bitnami/postgresql/secrets
architecture: replication, auth.replicationUsername, auth.replicationPasswordPOSTGRES_REPLICATION_MODE, POSTGRES_REPLICATION_USER, POSTGRES_REPLICATION_PASSWORD
primary.persistence.mountPath, postgresqlDataDirPOSTGRESQL_VOLUME_DIR=/bitnami/postgresql, PGDATA=/bitnami/postgresql/data
primary.initdb.scriptsA ConfigMap mounted at /docker-entrypoint-initdb.d
postgresqlSharedPreloadLibrariesPOSTGRESQL_SHARED_PRELOAD_LIBRARIES, pgaudit by default, so the image must include pgaudit

PostgreSQL versions OSSeva publishes

Each line below has a patched OSSeva image. The second column shows which bitnami/postgresql chart releases defaulted to that line, which tells you the chart major to stay on during the swap.

Version lineBitnami chart releases
PostgreSQL 11bitnami/postgresql 8.x to 10.x; bitnami/postgresql-ha 1.x to 8.x
PostgreSQL 12No chart release defaulted to 12, so these installs set image.tag themselves
PostgreSQL 13No chart release defaulted to 13, so these installs set image.tag themselves
PostgreSQL 14bitnami/postgresql 11.x; bitnami/postgresql-ha 9.x

Replication and high availability in the PostgreSQL charts

Setting architecture to replication adds a read StatefulSet with readReplicas.replicaCount pods (1 by default) that stream from the primary. Synchronous replication is off unless you set replication.synchronousCommit and replication.numSynchronousReplicas. The chart has no failover of its own: if the primary is lost, the replicas stay read-only until someone promotes one.

Failover is what bitnami/postgresql-ha adds, and that chart does not use the bitnami/postgresql image. Its database pods run bitnami/postgresql-repmgr (postgresql.image), where repmgr promotes a standby when the primary is unhealthy, and Pgpool-II from bitnami/pgpool (pgpool.image) routes client connections. postgresql.replicaCount defaults to 3. Repointing that chart means replacing both images and keeping the REPMGR_* and PGPOOL_* variables the chart renders.

CloudNativePG handles failover inside the operator, without repmgr or Pgpool-II, which is why it is the usual target for new HA deployments.

What happened to the Bitnami PostgreSQL image

For years, bitnami/postgresql on Docker Hub was one of the most common ways to deploy PostgreSQL on Kubernetes, usually through the Bitnami PostgreSQL Helm chart. On 28 August 2025 Broadcom moved every versioned Bitnami container image, including this one, to the bitnamilegacy repository, and removed the public docker.io/bitnami catalog on 29 September 2025. The free tier now offers only latest tags of a limited set of images for development.

The legacy Docker image still pulls, so existing deployments keep working. It no longer receives updates, which means every vulnerability disclosed since the move stays open in the PostgreSQL binary, in the base image and in every bundled dependency. Container scanners will report a growing count at every audit, and a workload that depends on a frozen public repository is one registry change away from ImagePullBackOff.

How to migrate PostgreSQL off Bitnami safely

  1. Find every reference to bitnami/postgresql and bitnamilegacy/postgresql in running workloads, Helm values files and CI pipelines, including init containers.
  2. Record the PostgreSQL version each deployment pins. Versions past upstream end of life are not covered by the free open source images.
  3. Take a backup and test a restore before touching a stateful workload.
  4. Mirror the replacement container images into your own registry, and scan them before you deploy.
  5. Move one replica or one environment at a time, and confirm the data path, file ownership and credentials on the new image.
  6. Remove every remaining legacy reference so nothing falls back to the archive on the next deploy.

Your options

OSSeva drop-in image

A patched image that keeps Bitnami's variables, paths and user, covering PostgreSQL 11 to 14, including versions past community end of life. Your chart keeps working after a registry change.

Official postgres image

Free and maintained for current versions. Apply the mapping above and move the volume.

CloudNativePG

A CNCF operator for PostgreSQL on Kubernetes, and the usual long-term replacement for the Bitnami postgresql and postgresql-ha charts.

Bitnami Secure Images

Broadcom's paid catalog keeps the Bitnami layout for supported versions, sold within TrueSource.

Repoint the Bitnami PostgreSQL Helm chart

  1. Run helm list to record the chart version, then helm get values <release> to save what is deployed.
  2. Keep that chart version. bitnami/postgresql 12.x moves the default to PostgreSQL 15, and a major version change needs pg_upgrade or a dump and restore, not a rolling restart.
  3. Override image.registry, image.repository and image.tag, with the tag on the same major version as the data directory. PostgreSQL will not start on a data directory written by another major version.
  4. Leave out global.security.allowInsecureImages. Bitnami added that image check in December 2024 (postgresql 16.3.0), and every chart that ships PostgreSQL 11 to 14 is older.
  5. Run helm upgrade with --reuse-values and the override. Afterwards, SELECT version() should show the new build, and pg_stat_replication on the primary should list every read replica.
# values-osseva.yaml
# helm upgrade my-postgresql oci://registry-1.docker.io/bitnamicharts/postgresql \
#   --version 11.9.13 --reuse-values -f values-osseva.yaml
image:
  registry: registry.example.com   # OSSeva registry or your mirror of it
  repository: postgresql
  tag: "<14.x tag>"                # same major version as the data directory
global:
  imagePullSecrets:
    - registry-credentials

This works only with an image that keeps Bitnami's layout. With the official image, rewrite the chart or move to an operator. See replacing bitnamilegacy images for the full inventory and rollout steps.

Frequently asked questions

What is the best alternative to the Bitnami PostgreSQL image?

To keep the Bitnami PostgreSQL Helm chart unchanged, use a Bitnami-compatible image; OSSeva ships patched ones covering PostgreSQL 11 to 14, including versions past community end of life. To rewrite the deployment, use the official postgres image or CloudNativePG.

Is bitnamilegacy/postgresql still getting security updates?

No. Bitnami moved versioned images to the bitnamilegacy repository on 28 August 2025 and describes it as receiving no further updates. It had about 17.5 million pulls by September 2026.

Can I keep using the Bitnami PostgreSQL Helm chart?

Yes, with a maintained image that keeps Bitnami's layout. Set image.registry and image.repository in your values file, and set global.security.allowInsecureImages to true, because recent Bitnami charts refuse non-Bitnami images otherwise.

Is Bitnami no longer free?

Not for production. Since 28 August 2025, versioned Bitnami images live in the bitnamilegacy repository with no updates, and the free tier offers latest tags of a limited set of images for development. Maintained, versioned images are sold as Bitnami Secure Images, which Broadcom prices by quote.

Where does the Bitnami PostgreSQL image store data?

Under /bitnami/postgresql. The official image uses /var/lib/postgresql (PGDATA), so the volume mount must change when you switch images.

Keep your PostgreSQL chart. Change the image.

Send us your image list and versions; we reply with coverage and a migration plan within five working days.