# PostgreSQL 18 update for self-hosters

**URL:** https://meta.discourse.org/t/postgresql-18-update-for-self-hosters/406194
**Category:** Announcements
**Created:** [August 3, 2026, 4:36am UTC](https://meta.discourse.org/t/postgresql-18-update-for-self-hosters/406194 "2026-08-03T04:36:42Z")
**Posts on this page:** 1
**Showing post:** 90

<div class="post-metadata">

### Author: ![terminus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/terminus/32/577812_2.png) [@terminus](https://meta.discourse.org/u/terminus)
#### Post date: [September 15, 2026, 1:46pm UTC](https://meta.discourse.org/t/postgresql-18-update-for-self-hosters/406194/90 "2026-09-15T13:46:25Z")

</div>

I am running Discourse in a standalone Docker container on `/var/discourse`.

I attempted to upgrade the embedded PostgreSQL database from version 15 to 18. The upgrade appeared to complete, and the active data directory now reports:

```plaintext
/shared/postgres_data/PG_VERSION
18

```

However, the rebuilt Discourse container still contains only PostgreSQL 15 binaries:

```plaintext
/usr/lib/postgresql/15/bin/postgres
postgres (PostgreSQL) 15.18

```

The PostgreSQL service is configured to run:

```plaintext
/usr/lib/postgresql/15/bin/postmaster -D /etc/postgresql/15/main

```

while the actual Discourse data directory is mounted at:

```plaintext
/shared/postgres_data

```

PostgreSQL consequently fails with:

```plaintext
FATAL: database files are incompatible with server

DETAIL: The data directory was initialized by PostgreSQL version 18,
which is not compatible with this version 15.18
(Debian 15.18-1.pgdg12+1).

```

I understand that recent Discourse Docker images are supposed to include PostgreSQL 18 binaries. I changed `app.yml` to use the PostgreSQL 18 template and rebuilt the app, but the resulting container still has PostgreSQL 15 binaries and the service script still points to `/etc/postgresql/15/main`.

The relevant portion of my current service configuration is:

```plaintext
HOME=/var/lib/postgresql USER=postgres exec thpoff \
chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert \
/usr/lib/postgresql/15/bin/postmaster -D /etc/postgresql/15/main

```

My questions are:

1. What is the correct way to rebuild or update the Discourse container so that it actually contains PostgreSQL 18 binaries?

2. Is there a particular template or image tag that should be used in `app.yml`?

3. Once PostgreSQL 18 is available, what is the supported procedure for starting it against the existing `/shared/postgres_data` directory?

I have not deleted or reinitialised the PostgreSQL 18 data directory. I would prefer to recover the upgraded cluster rather than restore the old PostgreSQL 15 data.

---

_[View the full topic](https://meta.discourse.org/t/postgresql-18-update-for-self-hosters/406194)._
