Postgresql

From Alpine Linux
Revision as of 12:59, 31 October 2025 by Jahway603 (talk | contribs) (Added PostgreSQL 17 section)

PostgreSQL is a well known opensource database that scales well and is easy to use.

PostgreSQL 17

To install PostgreSQL 17,

apk add postgresql17 postgresql17-contrib postgresql17-openrc

rc-update add postgresql

rc-service postgresql start

This will start the postgresql 15 server and perform some initial configuration. It will also create a system user called postgres.

To install, configure, and use PostgreSQL 17, which is the latest release as of Alpine v3.21, please refer to the PostgreSQL 16 Alpine Wiki page. It will also create a system user called postgres.

PostgreSQL 16

To install PostgreSQL 16,

apk add postgresql16 postgresql16-contrib postgresql16-openrc

rc-update add postgresql

rc-service postgresql start

To install, configure, and use PostgreSQL 16, please refer to the PostgreSQL 16 Alpine Wiki page. It will also create a system user called postgres.

PostgreSQL 15

To install PostgreSQL 15,

apk add postgresql15 postgresql15-contrib postgresql15-openrc

rc-update add postgresql

rc-service postgresql start

This will start the postgresql 15 server and perform some initial configuration. It will also create a system user called postgres.

To configure and use PostgreSQL, please refer to the PostgreSQL 16 Alpine Wiki page as the usage is the same.

PostgreSQL 14

To install PostgreSQL 14,

apk add postgresql14 postgresql14-contrib postgresql14-openrc

rc-update add postgresql

rc-service postgresql start

This will start the postgresql 14 server and perform some initial configuration. It will also create a system user called postgres.

To configure and use PostgreSQL, please refer to the PostgreSQL 16 Alpine Wiki page as the usage is the same.

Switching between PostgreSQL versions

On Alpine Linux, you can use the command `pg_versions` to switch between PostgreSQL versions. This is very helpful when upgrading the version you are using.

Upgrading PostgreSQL

Please follow along with this guide and adjust the version you are moving from and the version you are upgrading to.

There's also this older guide.