How to upgrade Dokku's PostgreSQL?

Hey guys, I am using this potsgres plugin: But they don’t provide any info on how to upgrade the postgresql version.

There is a fork that supports 9.4 version ( so I removed the old one, installed the new one, but nothing happens.

The old db is still running and I don’t want to mess with it since there is no manual on how to do it.

Hopefully this helps other folks than just me.


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Unfortunately, there is no easy way to accomplish this except for forking the plugin. With Dokku, everything is running inside of Docker containers including the database. If you look at the install script for Kloadut/dokku-pg-plugin, you’ll see that it builds a Docker image based on this Dockerfile:

FROM	ubuntu:trusty

# prevent apt from starting postgres right after the installation
RUN	echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d; chmod +x /usr/sbin/policy-rc.d

RUN apt-get update
RUN	LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install -y -q postgresql-9.3 postgresql-contrib-9.3
RUN rm -rf /var/lib/apt/lists/*
RUN apt-get clean

# allow autostart again
RUN	rm /usr/sbin/policy-rc.d

ADD	. /usr/bin
RUN	chmod +x /usr/bin/
RUN echo 'host all all md5' >> /etc/postgresql/9.3/main/pg_hba.conf
RUN sed -i -e"s/var\/lib/opt/g" /etc/postgresql/9.3/main/postgresql.conf

So the only way to run a different version of Postgres would be to fork the plugin and have it use a different Dockerfile.