# 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:** 20
**Page:** 4

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [August 13, 2026, 2:40pm UTC](https://meta.discourse.org/t/postgresql-18-update-for-self-hosters/406194/62 "2026-08-13T14:40:37Z")

</div>

> [@NateDhaliwal](#):
>
> Fixed with ChatGPT’s help. I’m no Linux/Postgres wizard.

Do you have a few more details? I am seeing the same

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [August 13, 2026, 9:33pm UTC](https://meta.discourse.org/t/postgresql-18-update-for-self-hosters/406194/63 "2026-08-13T21:33:22Z")

</div>

For those also seeing the same this is the summary (AI) of what I did:  
Temporarily start PG15 → Dump the database → Use PG18 → Restore the dump

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [August 13, 2026, 9:41pm UTC](https://meta.discourse.org/t/postgresql-18-update-for-self-hosters/406194/64 "2026-08-13T21:41:58Z")

</div>

So yeah this upgrade is image based.

So even if you choose to install an old version of Discourse, the image will still force an 18 upgrade?

Got it.

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [August 13, 2026, 11:12pm UTC](https://meta.discourse.org/t/postgresql-18-update-for-self-hosters/406194/65 "2026-08-13T23:12:42Z")

</div>

I see you’ve fixed it, but the method ChatGPT gave, while fixing the error, it still wiped my database, so essentially no accounts, no topics or posts.

Thankfully, it was a new-ish dev forum, so not too much lost.

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [August 13, 2026, 11:17pm UTC](https://meta.discourse.org/t/postgresql-18-update-for-self-hosters/406194/66 "2026-08-13T23:17:36Z")

</div>

It took great care to ensure that this didn’t happen today. After each step, it told me that this wouldn’t delete anything, and I had the impression we ensured three times that all data was migrated before we could agree on deleting the stuff we no longer needed.

But if it had gone wrong, the only data I would have missed would have been the theme component configuration.

---

<div class="post-metadata">

### Author: ![Saiano](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saiano/32/153394_2.png) [@Saiano](https://meta.discourse.org/u/Saiano)
#### Post date: [August 16, 2026, 5:17pm UTC](https://meta.discourse.org/t/postgresql-18-update-for-self-hosters/406194/68 "2026-08-16T17:17:18Z")

</div>

Hi, I have a forum with a fairly large database (around 80 GB). For the upgrade from version 13 to 15, I switched servers, performed a fresh installation, and restored the data.  
Do you still recommend this approach? (I tried the direct upgrade but encountered collation errors)

---

<div class="post-metadata">

### Author: ![Andrew\_Rowe](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/andrew_rowe/32/445877_2.png) [@Andrew\_Rowe](https://meta.discourse.org/u/Andrew_Rowe)
#### Post date: [August 16, 2026, 5:31pm UTC](https://meta.discourse.org/t/postgresql-18-update-for-self-hosters/406194/69 "2026-08-16T17:31:22Z")

</div>

> [@Saiano](#):
>
> For the upgrade from version 13 to 15, I switched servers, performed a fresh installation, and restored the data.  
> Do you still recommend this approach?

earlier in the topic staff stated:

> [@chrisr](#):
>
> > [@pfaffman](#):
> >
> > it’s much safer than upgrading a database major version.
> 
> True, but we’re aiming for a simple transparent upgrade mechanism. There are merits both ways.
> 
> I’d say do whatever you’re comfortable with and don’t be afraid to customise the templates in discourse\_docker as your needs require. Obviously the key is to test first and have a rollback plan.

So, yes it is an option

you already said:

> [@Saiano](#):
>
> I tried the direct upgrade but encountered collation errors

Collation errors? What version is the existing Discourse?

Maybe post what errors you encountered / console output

> [@Saiano](#):
>
> a fairly large database (around 80 GB)

but you didn’t run out of space (recommended 2 x existing database size) ?

---

<div class="post-metadata">

### Author: ![Saiano](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saiano/32/153394_2.png) [@Saiano](https://meta.discourse.org/u/Saiano)
#### Post date: [August 16, 2026, 5:52pm UTC](https://meta.discourse.org/t/postgresql-18-update-for-self-hosters/406194/70 "2026-08-16T17:52:00Z")

</div>

Hi, I have plenty of space (250 GB free). The error was “collation mismatch,” but I think I don’t have the UTF-8 strings in the app.yml file.

---

<div class="post-metadata">

### Author: ![chrisr](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisr/32/246622_2.png) [@chrisr](https://meta.discourse.org/u/chrisr)
#### Post date: [August 17, 2026, 12:21am UTC](https://meta.discourse.org/t/postgresql-18-update-for-self-hosters/406194/71 "2026-08-17T00:21:08Z")

</div>

> [@merefield](#):
>
> So even if you choose to install an old version of Discourse, the image will still force an 18 upgrade?

We try to provide sensible defaults in the discourse\_docker images but it’s not possible to account for every possible use case. Feel free to customise your images to hold versions back if you prefer.

To a certain extent the dependency versions reflect our hosting requirements - we use the base image internally. That means it shouldn’t get too stale, but also means there are only so many permutations we can maintain.

> [@Saiano](#):
>
> Hi, I have a forum with a fairly large database (around 80 GB). For the upgrade from version 13 to 15, I switched servers, performed a fresh installation, and restored the data.  
> Do you still recommend this approach? (I tried the direct upgrade but encountered collation errors)

That’s a perfectly valid method if you’re more comfortable with it.

> [@Saiano](#):
>
> he error was “collation mismatch,”

If the warning is generated while preparing to dump the old DB then this is nothing to worry about. We are only running the server against the old data directory for the purpose of running `pg_dump`. When the dump is restored into the new server indexes are recreated.

The reason you’re seeing this is that in the last few days we have released a new version of the base image which upgrades from Debian Bookworm to Trixie, changing the glibc version. Locales based on the `libc` provider (which you were probably using) are not stable across glibc upgrades, so when the upgrade script starts a Postgres server to dump your old data it displays collation mismatch warnings.

The collation mismatch is the whole reason we are doing the dump-and-restore instead of running `pg_upgrade`. Once your DB is using `C.UTF-8` with the `builtin` provider upgrades to glibc will no longer affect collations.

---

<div class="post-metadata">

### Author: ![Jonathan5](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jonathan5/32/197134_2.png) [@Jonathan5](https://meta.discourse.org/u/Jonathan5)
#### Post date: [August 17, 2026, 1:19am UTC](https://meta.discourse.org/t/postgresql-18-update-for-self-hosters/406194/72 "2026-08-17T01:19:44Z")

</div>

> [@chrisr](#):
>
> If the warning is generated while preparing to dump the old DB then this is nothing to worry about.

I performed the upgrade tonight and it went according to plan. I got the same database collation warnings, but it sounds like we should ignore them. Thanks.

---

<div class="post-metadata">

### Author: ![Saiano](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saiano/32/153394_2.png) [@Saiano](https://meta.discourse.org/u/Saiano)
#### Post date: [August 20, 2026, 6:34pm UTC](https://meta.discourse.org/t/postgresql-18-update-for-self-hosters/406194/73 "2026-08-20T18:34:24Z")

</div>

I tried to add the following to app.yml

app.yml  
templates:

- **“templates/postgres.15.template.yml”**
- “templates/redis.template.yml”
- “templates/web.template.yml”
- “templates/web.ratelimited.template.yml”

to postpone the upgrade, but I get this error

Errno::ENOENT: No such file or directory @ rb\_sysopen - /etc/postgresql/15/main/postgresql.conf  
Location of failure: /usr/local/lib/ruby/gems/3.4.0/gems/pups-1.4.0/lib/pups/replace\_command.rb:11:in ‘IO.read’  
replace failed with the params {“filename” =\> “/etc/postgresql/15/main/postgresql.conf”, “from” =\> “data\_directory = ‘/var/lib/postgresql/15/main’”, “to” =\> “data\_directory = ‘/shared/postgres\_data’”}  
bootstrap failed with exit code 1  
\*\* FAILED TO BOOTSTRAP \*\* please scroll up and look for earlier error messages, there may be more than one.  
./discourse-doctor may help diagnose the problem.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [August 20, 2026, 6:50pm UTC](https://meta.discourse.org/t/postgresql-18-update-for-self-hosters/406194/74 "2026-08-20T18:50:14Z")

</div>

Looks like it’s the wrong base container, I think. You did a `./launcher rebuild`? That should to a `git pull`, but you might try running a `git pull` to see if that changes things.

---

<div class="post-metadata">

### Author: ![Saiano](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saiano/32/153394_2.png) [@Saiano](https://meta.discourse.org/u/Saiano)
#### Post date: [August 25, 2026, 6:23am UTC](https://meta.discourse.org/t/postgresql-18-update-for-self-hosters/406194/75 "2026-08-25T06:23:17Z")

</div>

Same error

Digest: sha256:837e8ed4b5916baa36856b842ad84fe262b6b1b5550701f8844b13cc7acad7a5  
Status: Downloaded newer image for discourse/base:2.0.20260812-0036  
[docker.io/discourse/base:2.0.20260812-0036](http://docker.io/discourse/base:2.0.20260812-0036)  
Ensuring launcher is up to date  
Launcher is up-to-date  
Stopping old container

- /usr/bin/docker stop -t 600 app  
app  
2.0.20260812-0036: Pulling from discourse/base  
Digest: sha256:837e8ed4b5916baa36856b842ad84fe262b6b1b5550701f8844b13cc7acad7a5  
Status: Image is up to date for discourse/base:2.0.20260812-0036  
[docker.io/discourse/base:2.0.20260812-0036](http://docker.io/discourse/base:2.0.20260812-0036)  
/usr/local/lib/ruby/gems/3.4.0/gems/pups-1.4.0/lib/pups.rb  
/usr/local/bin/pups --stdin  
I, [2026-08-25T06:22:16.249062 #1] INFO – : Reading from stdin  
I, [2026-08-25T06:22:16.274434 #1] INFO – : File \> /etc/service/postgres/run chmod: +x chown:  
I, [2026-08-25T06:22:16.281650 #1] INFO – : File \> /etc/service/postgres/log/run chmod: +x chown:  
I, [2026-08-25T06:22:16.287846 #1] INFO – : File \> /etc/runit/3.d/99-postgres chmod: +x chown:  
I, [2026-08-25T06:22:16.293208 #1] INFO – : File \> /root/install\_postgres chmod: +x chown:  
I, [2026-08-25T06:22:16.299851 #1] INFO – : File \> /root/upgrade\_postgres chmod: +x chown:

## FAILED

Errno::ENOENT: No such file or directory @ rb\_sysopen - /etc/postgresql/15/main/postgresql.conf  
Location of failure: /usr/local/lib/ruby/gems/3.4.0/gems/pups-1.4.0/lib/pups/replace\_command.rb:11:in ‘IO.read’  
replace failed with the params {“filename” =\> “/etc/postgresql/15/main/postgresql.conf”, “from” =\> “data\_directory = ‘/var/lib/postgresql/15/main’”, “to” =\> “data\_directory = ‘/shared/postgres\_data’”}  
bootstrap failed with exit code 1  
\*\* FAILED TO BOOTSTRAP \*\* please scroll up and look for earlier error messages, there may be more than one.  
./discourse-doctor may help diagnose the problem.  
2d15a756bfd82ed45debfbb4936784721293a3aeecabe8ba9b58c64d4bbe16e1

---

<div class="post-metadata">

### Author: ![Ethsim2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ethsim2/32/522255_2.png) [@Ethsim2](https://meta.discourse.org/u/Ethsim2)
#### Post date: [August 25, 2026, 8:14am UTC](https://meta.discourse.org/t/postgresql-18-update-for-self-hosters/406194/76 "2026-08-25T08:14:57Z")

</div>

> [@Saiano](#):
>
> Same error

I think I found the cause.

The current base image installs the PostgreSQL 18 server, but `postgres.15.template.yml` still assumes that the PostgreSQL 15 server packages are already present. It therefore reaches:

```plaintext
/etc/postgresql/15/main/postgresql.conf

```

before that file exists, producing the ENOENT error above.

I’ve opened a small PR which makes the PostgreSQL 15 holdback template remove the PostgreSQL 18 server packages and install the PostgreSQL 15 server packages before configuring PostgreSQL:

> <https://github.com/discourse/discourse_docker/pull/1120>
>
> \`postgres.15.template.yml\` currently assumes that the PostgreSQL 15 server
> pack…ages are installed by the base image.
> 
> Since the base image moved to PostgreSQL 18, selecting
> \`templates/postgres.15.template.yml\` to postpone the PostgreSQL 18 upgrade
> fails during bootstrap with:
> 
> Errno::ENOENT: No such file or directory @ rb\_sysopen -
> /etc/postgresql/15/main/postgresql.conf
> 
> Install the PostgreSQL 15 server packages in the PostgreSQL 15 template,
> after removing the PostgreSQL 18 server packages.
> 
> This restores the intended PostgreSQL 15 holdback path.

This should restore the intended path where changing `postgres.template.yml` to `postgres.15.template.yml` postpones the PostgreSQL 18 upgrade.

---

<div class="post-metadata">

### Author: ![Saiano](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saiano/32/153394_2.png) [@Saiano](https://meta.discourse.org/u/Saiano)
#### Post date: [August 28, 2026, 6:13am UTC](https://meta.discourse.org/t/postgresql-18-update-for-self-hosters/406194/77 "2026-08-28T06:13:02Z")

</div>

Has the update been released?  
When will I be able to try again? (just for information)

---

<div class="post-metadata">

### Author: ![chrisr](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisr/32/246622_2.png) [@chrisr](https://meta.discourse.org/u/chrisr)
#### Post date: [August 28, 2026, 6:31am UTC](https://meta.discourse.org/t/postgresql-18-update-for-self-hosters/406194/78 "2026-08-28T06:31:05Z")

</div>

I’ve merged the fix (thanks @Ethsim2!) so you should be ok to try again.

---

<div class="post-metadata">

### Author: ![Saiano](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saiano/32/153394_2.png) [@Saiano](https://meta.discourse.org/u/Saiano)
#### Post date: [August 28, 2026, 6:52am UTC](https://meta.discourse.org/t/postgresql-18-update-for-self-hosters/406194/79 "2026-08-28T06:52:39Z")

</div>

> [@chrisr](#):
>
> I merged the fix (thanks @Ethsim2!), so you should be able to try again.

It works, thank you so much!

---

<div class="post-metadata">

### Author: ![AstonJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/astonj/32/215041_2.png) [@AstonJ](https://meta.discourse.org/u/AstonJ)
#### Post date: [August 29, 2026, 4:16am UTC](https://meta.discourse.org/t/postgresql-18-update-for-self-hosters/406194/80 "2026-08-29T04:16:47Z")

</div>

Has the upgrade gone ok for people with multiple containers on the same server? If I’ve got time this weekend I might upgrade ours - just thought I’d check here first in case I should hold off for now..

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [August 30, 2026, 2:29am UTC](https://meta.discourse.org/t/postgresql-18-update-for-self-hosters/406194/81 "2026-08-30T02:29:58Z")

</div>

yes i did upgrades on dual containers on one server a couple of weeks ago (on a russian server too). no issues at all but make sure you have enough disk space first.

---

<div class="post-metadata">

### Author: ![Eviepayne](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviepayne/32/352733_2.png) [@Eviepayne](https://meta.discourse.org/u/Eviepayne)
#### Post date: [August 30, 2026, 11:02pm UTC](https://meta.discourse.org/t/postgresql-18-update-for-self-hosters/406194/82 "2026-08-30T23:02:39Z")

</div>

protip for anyone doing postgres updates outside docker. You can use `--link` in pg\_upgrade so you don’t have to copy the data. You can hardlink that data. Saves disk space.

[Previous page](https://meta.discourse.org/t/postgresql-18-update-for-self-hosters/406194.md?page=3)

[Next page](https://meta.discourse.org/t/postgresql-18-update-for-self-hosters/406194.md?page=5)
