wimW
ZITADELβ€’6mo agoβ€’
13 replies
wim

postgres password problem

Hi, I am trying to run zitadel in a docker container on a vps. On the vps I also have a postgres db running, also in docker.

I created two users for zitadel: zitadel_root and zitadel_user. When I try to connect to the database with those users using DBeaver, everything works fine. But the Zitadel container gives the following error:

time="2025-09-23T20:36:47Z" level=info msg="initialization started" caller="/home/runner/work/zitadel/zitadel/cmd/initialise/init.go:70"
time="2025-09-23T20:36:47Z" level=fatal msg="unable to initialize the database" caller="/home/runner/work/zitadel/zitadel/cmd/initialise/init.go:63" error="failed to connect to
user=zitadel_root database=postgres
: 5.75.247.152:5432 (5.75.247.152): server error: FATAL: password authentication failed for user "zitadel_root" (SQLSTATE 28P01)"

When I go to the database container I see a corresponding log:
2025-09-23 20:36:47.626 UTC [71017] FATAL: password authentication failed for user "zitadel_root"
2025-09-23 20:36:47.626 UTC [71017] DETAIL: Password does not match for user "zitadel_root".
Connection matched file "/data/postgres/pg_hba.conf" line 120: "host all all 172.19.0.1/8 password"

I have configured zitadel using config files:
config.yaml
:
# All possible options and their defaults: https://github.com/zitadel/zitadel/blob/main/cmd/defaults.yaml
Log:
  Level: 'info'

ExternalDomain: <DOMAIN>
ExternalPort: 443
ExternalSecure: true

TLS:
  Enabled: true

Database:
  postgres:
    Host: '<PUBLIC IP ADDRESS OF DATABASE>'
    Port: 5432
    Database: zitadel
    User:
      Username: 'zitadel_user'
    Admin:
      Username: 'zitadel_root'

and
secrets.yaml
:
# All possible options and their defaults: https://github.com/zitadel/zitadel/blob/main/cmd/defaults.yaml

Database:
  postgres:
    User:
      Password: '<USER PASSWORD>'
    Admin:
      Password: '<ROOT PASSWORD>'


Anyone any idea what is going on?
Was this page helpful?