PostgreSQL: Linux downloads (Debian) (original) (raw)
PostgreSQL is available in all Debian versions by default. However, Debian "snapshots" a specific version of PostgreSQL that is then supported throughout the lifetime of that Debian version. The PostgreSQL project maintains an Apt repository with all supported of PostgreSQL available.
Included in Distribution
Debian includes PostgreSQL by default. To install PostgreSQL on Debian, use the apt
(or other apt-driving) command:
apt install postgresql
PostgreSQL Apt Repository
If the version included in your version of Debian is not the one you want, you can use the PostgreSQL Apt Repository. This repository will integrate with your normal systems and patch management, and provide automatic updates for all supported versions of PostgreSQL throughout the supportlifetime of PostgreSQL.
The PostgreSQL Apt repository supports the current versions of Debian:
- bookworm (12.x)
- bullseye (11.x)
- buster (10.x)
- trixie (testing)
- sid (unstable)
on the following architectures:
- amd64
- arm64
- ppc64el
Automated repository configuration:
sudo apt install -y postgresql-common sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh
To manually configure the Apt repository, follow these steps:
Import the repository signing key:
sudo apt install curl ca-certificates sudo install -d /usr/share/postgresql-common/pgdg sudo curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc
Create the repository configuration file:
. /etc/os-release sudo sh -c "echo 'deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt $VERSION_CODENAME-pgdg main' > /etc/apt/sources.list.d/pgdg.list"
Update the package lists:
sudo apt update
Install the latest version of PostgreSQL:
If you want a specific version, use 'postgresql-17' or similar instead of 'postgresql'
sudo apt -y install postgresql
For more information about the apt repository, including answers to frequent questions, please see thePostgreSQL Apt Repository wiki page.
Packages
The repository contains many different packages including third party addons. The most common and important packages are (substitute the version number as required):
postgresql-client-17 | client libraries and client binaries |
---|---|
postgresql-17 | core database server |
postgresql-doc-17 | documentation |
libpq-dev | libraries and headers for C language frontend development |
postgresql-server-dev-17 | libraries and headers for C language backend development |