Kong Postgres Configuration
Kong PostgreSQL stores routes, plugins, consumers, and credentials. Its container reads .kong-postgres.env during database initialization.
Environment variables
Section titled “Environment variables”Set every variable below. Replace the example password with a generated secret and use the same value for KONG_PG_PASSWORD in .kong.env.
| Variable | Default Value | Explanation |
|---|---|---|
POSTGRES_DB |
kong |
The name of the PostgreSQL database created on initialization for Kong. |
POSTGRES_USER |
kong |
The superuser username for the database. |
POSTGRES_PASSWORD |
<KONG_DB_PASSWORD> |
Secret. Use a unique generated password; it must match KONG_PG_PASSWORD. |
POSTGRES_HOST_AUTH_METHOD |
md5 |
The authentication method used for host connections. md5 ensures password-based authentication is required. |
POSTGRES_INITDB_ARGS |
--auth-host=md5 |
Arguments passed to initdb during initial database creation, enforcing md5 authentication from the start. |

