Installing PostGIS v3.1.2

The following table lists the latest PostGIS versions and their corresponding Advanced Server versions.

Note

The PostGIS version required by your Advanced Server installation is version-specific, but the documented and supported functionality of each version is the same. The information in this guide applies to each version listed in the table below.

PostGIS VersionSupported Advanced Server VersionsSupported Platforms
PostGIS 3.1Advanced Server 13RHEL/CentOS 7 and RHEL/CentOS 8 - x86_64
RHEL/CentOS 7 - ppc64le
Debian 9x Stretch and 10x Buster
Ubuntu 18.04 LTS Bionic Beaver and Ubuntu 20.04 LTS Focal Fossa
Windows 64 x86 Interactive Installer
PostGIS 3.1Advanced Server 12RHEL/CentOS 7 x86_64 and RHEL/CentOS 8 - x86_64
RHEL/CentOS 7 - ppc64le
Debian 9x Stretch and 10x Buster
Ubuntu 18.04 LTS Bionic Beaver
Windows 64 x86 Interactive Installer
SLES 12
PostGIS 3.1Advanced Server 11RHEL/CentOS 7 - x86_64 and RHEL/CentOS 8 - x86_64
RHEL/CentOS 7 - ppc64le
Debian 9x Stretch
Ubuntu 18.04 LTS Bionic Beaver
Windows 64 x86 Interactive Installer
PostGIS 3.1Advanced Server 9.6, 10RHEL/CentOS 7 - x86_64
RHEL/CentOS 7 - ppc64le
Windows 64 x86 Interactive Installer
PostGIS 3.0Advanced Server 13RHEL/CentOS 7 and RHEL/CentOS 8 - x86_64
RHEL/CentOS 7 - ppc64le
Debian 9x Stretch and 10x Buster
Ubuntu 18.04 LTS Bionic Beaver and Ubuntu 20.04 LTS Focal Fossa
Windows 64 x86 Interactive Installer
PostGIS 3.0Advanced Server 12RHEL/CentOS 7 x86_64 and RHEL/CentOS 8 - x86_64
RHEL/CentOS 7 - ppc64le
Debian 9x Stretch and 10x Buster
Ubuntu 18.04 LTS Bionic Beaver
Windows 64 x86 Interactive Installer
PostGIS 3.0Advanced Server 11RHEL/CentOS 7 - x86_64
PostGIS 2.5Advanced Server 12RHEL/CentOS 7 - x86_64 and RHEL/CentOS 8 - x86_64
RHEL/CentOS 7 - ppc64le
Debian 9x Stretch and 10x Buster
Ubuntu 18.04 LTS Bionic Beaver
Windows 64 x86 Interactive Installer
SLES 12
PostGIS 2.5Advanced Server 11RHEL/CentOS 7 - x86_64
RHEL/CentOS 7 - ppc64le
Debian 9x Stretch
Ubuntu 18.04 LTS Bionic Beaver
Windows 64 x86 Interactive Installer
SLES 12
PostGIS 2.4Advanced Server 9.6, 10 and 11RHEL/CentOS 7 - x86_64
RHEL/CentOS 7 - ppc64le
Windows 64 x86 Interactive Installer
PostGIS 2.3Advanced Server 9.6 and 10RHEL/CentOS 7 - x86_64
RHEL/CentOS 7 - ppc64le
Windows 64 x86 Interactive Installer
Note

PostGIS is no longer supported on CentOS/RHEL/OL 6.x platforms. It is strongly recommended that EDB products running on these platforms be migrated to a supported platform.

Installing PostGIS on a CentOS Host

Before creating the repository configuration file, you must have credentials that allow access to the EnterpriseDB repository. For information about requesting credentials, visit the EDB website.

Perform the following steps to install PostGIS on a CentOS Host:

  1. To create the repository configuration file, assume superuser privileges, and invoke the platform-specific command:

    On CentOS 7:

    yum -y install https://yum.enterprisedb.com/edbrepos/edb-repo-latest.noarch.rpm

    On CentOS 8:

    dnf -y install https://yum.enterprisedb.com/edbrepos/edb-repo-latest.noarch.rpm
  2. Replace the USERNAME:PASSWORD variable in the following command with the username and password of a registered EnterpriseDB user:

    sed -i "s@<username>:<password>@USERNAME:PASSWORD@" /etc/yum.repos.d/edb.repo
  3. Before installing PostGIS, you need to install the Extra Packages for Enterprise Linux (EPEL) release package:

    On CentOS 7:

    yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

    On CentOS 8:

    dnf -y install epel-release
  4. The following steps are applicable only for CentOS 8 platform:

    a. Enable the PowerTools repository to satisfy package dependencies:

    dnf config-manager --set-enabled PowerTools

    b. Disable the built-in PostgreSQL module:

    dnf -qy module disable postgresql
  5. Invoke the platform-specific command to install PostGIS:

    On CentOS 7, to install the latest version of PostGIS version for EDB Advanced Server version 13.0:

    yum -y install edb-as13-postgis3

    On CentOS 8, to install the latest version of PostGIS version for EDB Advanced Server version 13.0:

    dnf -y install edb-as13-postgis3

    On CentOS 7, to install the latest version of PostGIS for EDB Advanced Server versions older than 13.0:

    yum -y install edb-as<xx>-postgis

    Where <xx> denotes the Advanced Server version older than 13.0.

    On CentOS 7, to install PostGIS older versions (for example PostGIS 3.0.2) for EDB Advanced Server version 13.0:

    yum -y install edb-as13-postgis3-3.0.2

    On CentOS 7, to install older PostGIS versions for EDB Advanced Server versions older than 13.0:

    yum -y install edb-as<xx>-postgis-<y.y.y>

    Where <xx> is the Advanced Server version older than 13.0 and<y.y.y> is the older PostGIS version.

    For example, to install PostGIS 2.5.4 on Advanced Server 12:

    yum -y install edb-as12-postgis-2.5.4

    When you install an RPM package signed by a source that is not recognized by your system, yum may ask for your permission to import the key to your local server. If prompted, and you are satisfied that the packages come from a trustworthy source, enter y and press Return to continue.

    Note

    After installing PostGIS with a package manager, you must manually create a template database and the required PostGIS extension.

Installing PostGIS on an RHEL Host

Before installing the repository configuration file, you must have credentials that allow access to the EnterpriseDB repository. For information about requesting credentials, visit the EDB website.

Perform the following steps to install PostGIS on an RHEL Host:

  1. To create the repository configuration file, assume superuser privileges, and invoke the platform-specific command:

    On RHEL 7:

    yum -y install https://yum.enterprisedb.com/edbrepos/edb-repo-latest.noarch.rpm

    On RHEL 8:

    dnf -y install https://yum.enterprisedb.com/edbrepos/edb-repo-latest.noarch.rpm
  2. Replace the USERNAME:PASSWORD variable with the username and password of a registered EnterpriseDB user:

    sed -i "s@<username>:<password>@USERNAME:PASSWORD@" /etc/yum.repos.d/edb.repo
  3. Before installing PostGIS, you need to install the Extra Packages for Enterprise Linux (EPEL) release package:

    On RHEL 7:

    yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

    On RHEL 8:

    dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
  4. Enable additional platform-specific repositories:

    On RHEL 7, enable the optional, extras, and HA repositories to satisfy package dependencies:

    subscription-manager repos --enable "rhel-*-optional-rpms" --enable "rhel-*-extras-rpms"  --enable "rhel-ha-for-rhel-*-server-rpms"

    On RHEL 8, enable the codeready-builder-for-rhel-8-*-rpms repository to satisfy EPEL packages dependency:

    ARCH=$( /bin/arch )
    
    subscription-manager repos --enable "codeready-builder-for-rhel-8-${ARCH}-rpms"
  5. On RHEL 8 platform, disable the built-in PostgreSQL module:

    dnf -qy module disable postgresql
  6. Invoke the platform-specific command to install PostGIS:

    On RHEL 7, to install the latest version of PostGIS for EDB Advanced Server version 13.0:

    yum -y install edb-as13-postgis3

    On RHEL 8, to install the latest version of PostGIS for EDB Advanced Server version 13.0:

    dnf -y install edb-as13-postgis3

    On RHEL 7, to install the latest version of PostGIS for EDB Advanced Server version older than 13.0:

    yum -y install edb-as<xx>-postgis

    Where <xx> denotes the Advanced Server version older than 13.0

    On RHEL 7, to install PostGIS older versions (for example PostGIS 3.0.2) for EDB Advanced Server version 13.0:

    yum -y install edb-as13-postgis3-3.0.2

    On RHEL 7, to install older PostGIS versions for EDB Advanced Server version older than 13.0:

    yum -y install edb-as<xx>-postgis-<y.y.y>

    Where <xx> is the Advanced Server version older than 13.0 and<y.y.y> is the older PostGIS version.

    For example, to install PostGIS 2.5.4 on EDB Advanced Server version 12:

    yum -y install edb-as12-postgis-2.5.4

    When you install an RPM package signed by a source that is not recognized by your system, yum may ask for your permission to import the key to your local server. If prompted, and you are satisfied that the packages come from a trustworthy source, enter y and press Return to continue.

    Note

    After installing PostGIS with a package manager, you must manually create a template database and the required PostGIS extension.

Installing PostGIS on an RHEL/CentOS 7 PPCLE Host

Before installing the repository configuration, you must have credentials that allow access to the EnterpriseDB repository. For information about requesting credentials, visit the EDB website.

Perform the following steps to install PostGIS on an RHEL/CentOS 7 PPC64LE Host.

  1. Create the Advance Toolchain repository configuration file:

    rpm --import https://public.dhe.ibm.com/software/server/POWER/Linux/toolchain/at/redhat/RHEL7/gpg-pubkey-6976a827-5164221b
    
    cat > /etc/yum.repos.d/advance-toolchain.repo <<EOF
    
    # Beginning of the configuration file
    [advance-toolchain]
    name=Advance Toolchain IBM FTP
    baseurl=https://public.dhe.ibm.com/software/server/POWER/Linux/toolchain/at/redhat/RHEL7
    failovermethod=priority
    enabled=1
    gpgcheck=1
    gpgkey=ftp://public.dhe.ibm.com/software/server/POWER/Linux/toolchain/at/redhat/RHELX/gpg-pubkey-6976a827-5164221b
    # End of the configuration file
  2. To create the EnterpriseDB repository configuration file, assume superuser privileges and invoke the following command:

    yum -y install https://yum.enterprisedb.com/edbrepos/edb-repo-latest.noarch.rpm
  3. Replace the USERNAME:PASSWORD variable with the username and password of a registered EnterpriseDB user:

    sed -i "s@<username>:<password>@USERNAME:PASSWORD@" /etc/yum.repos.d/edb.repo
  4. Before installing PostGIS, you need to install the Extra Packages for Enterprise Linux (EPEL) release package:

    yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
  5. On RHEL 7, enable the optional, extras, and HA repositories to satisfy package dependencies:

    subscription-manager repos --enable "rhel-*-optional-rpms" --enable "rhel-*-extras-rpms"  --enable "rhel-ha-for-rhel-*-server-rpms"
  6. Invoke the following command to install PostGIS:

    To install the latest version of PostGIS version for EDB Advanced Server version 13.0:

    yum -y install edb-as13-postgis3

    To install the latest version of PostGIS for EDB Advanced Server version older than 13.0:

    yum -y install edb-as<xx>-postgis

    Where <xx> denotes the Advanced Server version older than 13.0

    To install PostGIS older versions (for example PostGIS 3.0.2) for EDB Advanced Server version 13.0:

    yum -y install edb-as13-postgis3-3.0.2

    To install older PostGIS versions for EDB Advanced Server versions older than 13.0:

    yum -y install edb-as<xx>-postgis-<y.y.y>

    Where <xx> is the Advanced Server version older than 13.0 and<y.y.y> is the older PostGIS version.

    For example, to install PostGIS 2.5.4 on EDB Advanced Server version 12:

    yum -y install edb-as12-postgis-2.5.4

    When you install an RPM package signed by a source that is not recognized by your system, yum may ask for your permission to import the key to your local server. If prompted, and you are satisfied that the packages come from a trustworthy source, enter y and press Return to continue.

    Note

    After installing PostGIS with a package manager, you must manually create a template database and the required PostGIS extension.

Installing PostGIS on a Debian/Ubuntu Host

To install a PostGIS package on a Debian or Ubuntu host, you must have credentials to access the EnterpriseDB repository. If you need EnterpriseDB credentials, visit the EDB website for credentials.

Perform the following steps to install PostGIS Debian package using the EnterpriseDB repository:

  1. Assume superuser privileges:

    sudo su –
  2. Configure the EnterpriseDB repository.

    On Debian 9, Ubuntu 18, and Ubuntu 20, invoke the folloiwng command and substitute your EnterpriseDB credentials for the username and password placeholders.

    sh -c 'echo "deb https://username:password@apt.enterprisedb.com/$(lsb_release -cs)-edb/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/edb-$(lsb_release -cs).list'

    On Debian 10:

    a. Set up the EnterpriseDB repository:

    sh -c 'echo "deb [arch=amd64] https://apt.enterprisedb.com/$(lsb_release -cs)-edb/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/edb-$(lsb_release -cs).list'

    b. Substitute your EnterpriseDB credentials for the username and password placeholders in the following command:

    sh -c 'echo "machine apt.enterprisedb.com login <username> password <password>" > /etc/apt/auth.conf.d/edb.conf'
  3. Add support to your system for secure APT repositories:

    apt-get install apt-transport-https
  4. Add the EDB signing key:

    wget -q -O - https://apt.enterprisedb.com/edb-deb.gpg.key  | sudo apt-key add -
  5. Update the repository metadata:

    apt-get update
  6. Install the Debian package:

    To install the latest version of PostGIS for EDB Advanced Server version 13.0:

    apt-get install edb-as13-postgis3

    To install the latest version of PostGIS for EDB Advanced Server version older than 13.0:

    apt-get install edb-as<xx>-postgis

    Where <xx> is the Advanced Server version older than 13.0

    For example, to install the latest version of PostGIS for EDB Advanced Server version 12:

    apt-get install edb-as12-postgis

    To install specific PostGIS version, for example 3.1.1, on Debian platforms for EDB Advanced Server version, for example 11, invoke the following commands:

    On Debian 9:

    apt-get install edb-as11-postgis-3.1=3.1.1-1+deb9

    On Debian 10:

    apt-get install edb-as11-postgis-3.1=3.1.1-1+deb10

    On Ubuntu 18.04:

    apt install edb-as11-postgis-3.1=3.1.1-1+ubuntu4

    On Ubuntu 20.04

    apt install edb-as11-postgis-3.1=3.1.1-1+ubuntu5

Installing PostGIS on a SLES 12 Host

Perform the following steps to install PostGIS on an SLES Host using the Zypper package manager:

Zypper will attempt to satisfy package dependencies as it installs a package but requires access to specific repositories not hosted at EDB.

  1. Assume superuser privileges.

    sudo su -
  2. Use the following command to add the EDB repository to your SLES host:

    zypper addrepo https://zypp.enterprisedb.com/suse/edb-sles.repo
  3. Invoke the following command to refresh the metadata:

    zypper refresh
  4. Install SUSEConnect to register the host with SUSE to allow access to SUSE repositories:

    zypper install SUSEConnect
  5. Register the host with SUSE to allow access to SUSE repositories and replace 'REGISTRATION_CODE' and 'EMAIL' with your SUSE registration information:

    SUSEConnect -r 'REGISTRATION_CODE' -e 'EMAIL'
    SUSEConnect -p PackageHub/12.4/x86_64
    SUSEConnect -p sle-sdk/12.4/x86_64
  6. Install the following repository for PEM dependencies:

    zypper addrepo https://download.opensuse.org/repositories/Apache:/Modules/SLE_12_SP4/Apache:Modules.repo
  7. Refresh the metadata:

    zypper refresh
  8. Install OpenJDK (version 1.8) for Java-based components:

    zypper -n install java-1_8_0-openjdk
  9. Use the zypper utility to install PostGIS:

    zypper -n install edb-as12-postgis

Installing PostGIS on a Windows Host

You must install Advanced Server before installing PostGIS. If you have used the graphical Setup wizard to install EDB Postgres Advanced Server, you can use StackBuilder Plus to add PostGIS to your installation. For details about using the graphical installer to install and configure Advanced Server, see the EDB Postgres Advanced Server Installation Guide for Windows.

Note

To install PostGIS version 3.1 on EDB Postgres Advanced Server version 9.6 or 10 on Windows, you need to upgrade it to the latest EDB Postgres Advanced Server minor version of 9.6.21.28 or 10.16.25 (or later), and then proceed with PostGIS 3.1 installation.

  1. Open StackBuilder Plus and select your Advanced Server installation from the drop-down list on the Welcome window. Click Next to continue to the application selection page.

    The StackBuilder Plus Welcome window Fig. 1: The StackBuilder Plus Welcome window

  2. Expand the Spatial Extensions node, and check the box next to the PostGIS version. Click Next to continue.

  3. The selected packages and the default download directory are displayed; change the locations if required. Click Next.

    The Installation Directory window Fig. 2: The Installation Directory window

  4. Once you have downloaded the installation files, a confirmation message is displayed. Click Next to start the PostGIS installation.

    Installing Postgis Fig. 3: Installing Postgis

  5. Select an installation language and click OK.

  6. The PostGIS welcome screen is displayed. Click Next.

    The Postgis welcome window Fig. 4: The Postgis welcome window

  7. Use the Installation Directory field to specify the directory you wish to install the PostGIS software. Click Next to continue.

  8. Use fields on the EDB Postgres Advanced Server Installation Details window to provide connection information for the Advanced Server host:

    • Use the Host field to identify the system on which Advanced Server resides.

    • Provide the name of the role that PostGIS will use for connections to the server in the User Name field.

    • Provide the password associated with the role in the Password field.

    • Use the Port field to identify the listener port that Advanced Server monitors for client connections.

      Click Next to continue.

      The Advanced Server installation details window Fig. 5: The Advanced Server installation details window

  9. The Ready to Install window notifies you when the installer has all of the information needed to install PostGIS on your system. Click Next.

    The ready to install window Fig. 6: The ready to install window

  10. Progress bars inform you as the installation progresses. Click Finish to exit the installer when the PostGIS installation completes.

    The installation is complete

    Fig. 7: The installation is complete

    StackBuilder Plus will install PostGIS and create the template_postgis database and PostGIS functions.