Skip to content
logo
Percona Product Documentation
Install on Debian and Ubuntu
Initializing search
    percona/postgresql-docs
    percona/postgresql-docs
    • Percona Distribution for PostgreSQL 11 Documentation
        • Overview
        • Install on Debian and Ubuntu
          • Preconditions
          • Procedure
            • Configure Percona repository
            • Install packages
            • Start the service
            • Connect to the PostgreSQL server
        • Install on RHEL and derivatives
        • Enable Percona Distribution for PostgreSQL extensions
        • Repositories overview
      • Migrate from PostgreSQL to Percona Distribution for PostgreSQL
      • Minor Upgrade of Percona Distribution for PostgreSQL
      • pg_stat_monitor
      • High availability
        • Deploying on Debian or Ubuntu
        • Deploying on RHEL or CentOS
        • Testing the Patroni PostgreSQL Cluster
      • Backup and disaster recovery
        • Deploying backup and disaster recovery solution in Percona Distribution for PostgreSQL
      • LDAP authentication
    • Uninstall
      • Release notes index
      • Percona Distribution for PostgreSQL 11.18 (2022-12-08)
      • Percona Distribution for PostgreSQL 11.17 (2022-09-08)
      • Percona Distribution for PostgreSQL 11.16 (2022-06-07)
      • Percona Distribution for PostgreSQL 11.15 Second Update (2022-05-05)
      • Percona Distribution for PostgreSQL 11.15 Update (2022-04-14)
      • Percona Distribution for PostgreSQL 11.15 (2022-04-08)
      • Percona Distribution for PostgreSQL 11.14 (2021-12-20)
      • Percona Distribution for PostgreSQL 11.13 Update (2021-12-07)
      • Percona Distribution for PostgreSQL 11.13 (2021-09-09)
      • Percona Distribution for PostgreSQL 11.12 Third Update (2021-07-15)
      • Percona Distribution for PostgreSQL 11.12 Second Update (2021-07-01)
      • Percona Distribution for PostgreSQL 11.12 Update (2021-06-10)
      • Percona Distribution for PostgreSQL 11.12 (2021-05-24)
      • Percona Distribution for PostgreSQL 11.11 Third Update (2021-06-10)
      • Percona Distribution for PostgreSQL 11.11 Second Update (2021-05-10)
      • Percona Distribution for PostgreSQL 11.11 Update (2021-04-12)
      • Percona Distribution for PostgreSQL 11.11 (2021-03-08)
      • Percona Distribution for PostgreSQL 11.10 Update (2021-06-10)
      • Percona Distribution for PostgreSQL 11.10 (2020-12-15)
      • Percona Distribution for PostgreSQL 11.9 (2020-09-08)
      • Percona Distribution for PostgreSQL 11.8 (2020-06-11)
      • Percona Distribution for PostgreSQL 11.7 (2020-04-09)
      • Percona Distribution for PostgreSQL 11.6 (2020-01-23)
      • Percona Distribution for PostgreSQL 11 (2019-09-17)
      • Percona Distribution for PostgreSQL 11 (Beta) (2019-05-15)
    • Licensing
    • Preconditions
    • Procedure
      • Configure Percona repository
      • Install packages
      • Start the service
      • Connect to the PostgreSQL server

    Install Percona Distribution for PostgreSQL on Debian and Ubuntu¶

    This document describes how to install Percona Server for PostgreSQL from Percona repositories on DEB-based distributions such as Debian and Ubuntu.

    Preconditions¶

    Debian and other systems that use the apt package manager include the upstream PostgreSQL server package (postgresql-11) by default. The components of Percona Distribution for PostgreSQL 11 can only be installed together with the PostgreSQL server shipped by Percona (percona-postgresql-11). If you wish to use Percona Distribution for PostgreSQL, uninstall the upstream postgresql-11 package and then install the chosen components from Percona Distribution for PostgreSQL.

    Procedure¶

    Run all the commands in the following sections as root or using the sudo command:

    Configure Percona repository¶

    1. Install the percona-release repository management tool to subscribe to Percona repositories:

      • Fetch percona-release packages from Percona web:

        $ wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
        
      • Install the downloaded package with dpkg:

        $ sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
        
      • Refresh the local cache:

        $ sudo apt update
        
    2. Enable the repository

    Percona provides two repositories for Percona Distribution for PostgreSQL. We recommend enabling the Major release repository to timely receive the latest updates.

    To enable a repository, we recommend using the setup command:

    $ sudo percona-release setup ppg-11
    

    Install packages¶

    $ sudo apt install percona-ppg-server-11
    
    1. Install the PostgreSQL server package:

      $ sudo apt install percona-postgresql-11
      
    2. Install the components:

      Install pg_repack:

      $ sudo apt install percona-postgresql-11-repack
      

      Install pgAudit:

      $ sudo apt install percona-postgresql-11-pgaudit
      

      Install pgBackRest:

      $ sudo apt install percona-pgbackrest
      

      Install Patroni:

      $ sudo apt install percona-patroni
      

      Install pg_stat_monitor

      Install pgBouncer:

      $ sudo apt install percona-pgbouncer
      

      Install pgAudit-set_user:

      $ sudo apt install percona-pgaudit15-set-user
      

      Install pgBadger:

      $ sudo apt install percona-pgbadger
      

      Install wal2json:

      $ sudo apt install percona-postgresql-11-wal2json
      

      Install PostgreSQL contrib extensions:

      $ sudo apt install percona-postgresql-contrib
      

      Install HAProxy

      $ sudo apt install percona-haproxy
      

      Some extensions require additional setup in order to use them with Percona Distribution for PostgreSQL. For more information, refer to Enabling extensions.

    Start the service¶

    The installation process automatically initializes and starts the default database. You can check the database status using the following command:

    $ sudo systemctl status postgresql.service
    

    Connect to the PostgreSQL server¶

    By default, postgres user and postgres database are created in PostgreSQL upon its installation and initialization. This allows you to connect to the database as the postgres user.

    $ sudo su postgres
    

    Open the PostgreSQL interactive terminal:

    $ psql
    

    Hint

    You can connect to psql as the postgres user in one go:

    $ sudo su postgres psql
    

    To exit the psql terminal, use the following command:

    $ \q
    

    Contact Us

    For free technical help, visit the Percona Community Forum.

    To report bugs or submit feature requests, open a JIRA ticket.

    For paid support and managed or consulting services , contact Percona Sales.


    Last update: March 29, 2023
    Created: December 5, 2022
    Percona LLC, © 2022
    Made with Material for MkDocs

    Cookie consent

    We use cookies to recognize your repeated visits and preferences, as well as to measure the effectiveness of our documentation and whether users find what they're searching for. With your consent, you're helping us to make our documentation better.