# How to create Percona Postgres HA cluster with Docker on 3 nodes?

**URL:** <https://forums.percona.com/t/how-to-create-percona-postgres-ha-cluster-with-docker-on-3-nodes/38604>\
**Category:** PostgreSQL\
**Tags:** postgres\
**Created:** [July 8, 2025, 9:32pm UTC](https://forums.percona.com/t/how-to-create-percona-postgres-ha-cluster-with-docker-on-3-nodes/38604 "2025-07-08T21:32:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://forums.percona.com/u/bluepuma77)\
**Post date:** [July 8, 2025, 9:32pm UTC](https://forums.percona.com/t/how-to-create-percona-postgres-ha-cluster-with-docker-on-3-nodes/38604/1 "2025-07-08T21:32:10Z")

</div>

There is great documentation about running **Percona Postgres in Docker**  
[Run Percona Distribution for PostgreSQL in a Docker container](https://docs.percona.com/postgresql/15/docker.html) - v15  
[Run Percona Distribution for PostgreSQL in a Docker container](https://docs.percona.com/postgresql/17/docker.html) - v17

And there is great documentation about running **Percona Postgres HA** on Debian  
[Deploying PostgreSQL for high availability with Patroni on Debian](https://docs.percona.com/postgresql/15/solutions/ha-setup-apt.html) - v15  
[Deploying PostgreSQL for high availability with Patroni on Debian](https://docs.percona.com/postgresql/17/solutions/ha-setup-apt.html) - v17

What I could not find is a doc for **Percona Postgres HA in Docker** on 3 nodes.

Does the Docker [percona-distribution-postgresql](https://hub.docker.com/r/percona/percona-distribution-postgresql) image even contain a Patroni installation? Or is there another image available? There seems to be an old [Percona postgres-ha Dockerfile](https://github.com/percona/percona-docker/tree/main/postgresql-containers/build/postgres-ha) on Github with HA in the name. [Percona postgres Dockerfile](https://github.com/percona/percona-docker/blob/main/postgresql-containers/build/postgres/Dockerfile) also seems to include Patroni. But running `patronictl` does not work. `rpm -qa | grep -i patroni` shows nothing. Or should Patroni be better run in a separate image? But which one, there seems to be no official one?

What I am looking for is a doc or tutorial how to setup **Percona Postgres HA in Docker** on 3 nodes. I would love to get a simple Docker compose file, to be run on each node. It could consist of `etcd` and Percona Postgres, no haproxy needed. Best case it would only need an env file like this to run:

```auto
HOST=db-1.internal # unique per node
HOST_IP=100.64.0.1 # unique per node
HOST_1=db-1.internal
HOST_2=db-2.internal
HOST_3=db-3.internal

POSTGRES_PASSWORD=super-secret-1
REPLICATION_PASSWORD=super-secret-2

```

Is this possible? Does such a doc or tutorial exist?

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://forums.percona.com/u/bluepuma77)\
**Post date:** [July 11, 2025, 11:26am UTC](https://forums.percona.com/t/how-to-create-percona-postgres-ha-cluster-with-docker-on-3-nodes/38604/2 "2025-07-11T11:26:12Z")

</div>

So I got `zalando/spilo` up and running for a basic Postgres HA cluster on 3 Docker nodes ([post](https://github.com/patroni/patroni/discussions/3401#discussioncomment-13720519)). Zalando uses an internal fork now, the [repo](https://github.com/zalando/spilo) seems more or less abandoned, the last [image](https://github.com/zalando/spilo/pkgs/container/spilo-17) is from 2024, the last [official release](https://github.com/zalando/spilo/releases) from 2023.

I am still be interested if and how this can be done with Percona Postgres.

---

<div class="post-metadata">

**Author:** ![Agustin\_G](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/agustin_g/32/14111_2.png) [@Agustin\_G](https://forums.percona.com/u/Agustin_G)\
**Post date:** [July 12, 2025, 2:52am UTC](https://forums.percona.com/t/how-to-create-percona-postgres-ha-cluster-with-docker-on-3-nodes/38604/3 "2025-07-12T02:52:18Z")

</div>

Hi @bluepuma77,

We don’t provide an official way of doing this with Docker/compose. You may be interested in checking the following forum discussion:

> [@Percona HA solution with postgres running in docker](https://forums.percona.com/t/percona-ha-solution-with-postgres-running-in-docker/36579):
>
> We are exploring migrating our application to use Percona postgreql due to the high availability solution. We currently have the following requirements: Our existing solution is using timescaledb and postgis. We need to be able to roll out clustered environments quickly with automation being an integral part of the solution. We run the timescaledb-tune command on initial startup to configure the memory, worker threads etc. We currently use a docker image for doing local development and using …

Best,  
Agustín.
