Installing PostGIS v1.0

Edit this page

The following table lists the latest PostGIS versions and their corresponding Advanced Server versions. 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 11RHEL/CentOS 8 - x86_64
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, 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, and RHEL/CentOS 8 - x86_64 RHEL/CentOS 7 - ppc64le Debian 9x Stretch Ubuntu 18.04 LTS Bionic Beaver Windows 64 x86 Interactive Installer SLES 12
PostGIS 2.5Advanced Server 9.6RHEL/CentOS 7 - x86_64
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

CentOS/RHEL/OEL 6.x platform does not support PostGIS. EDB strongly recommends migrating all EDB products running on these platforms to a supported platform.

Installing PostGIS on a CentOS Host

You must install Advanced Server before installing PostGIS. For details about installing and configuring Advanced Server, see the EDB Advanced Server Installation Guide available at the EDB website.

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:

  1. To create the repository configuration file, assume superuser privileges and invoke one of the following platform-specific commands:

    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 placeholder 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, execute the following command 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. On CentOS 8, enable the PowerTools repository to satisfy package dependencies:

    dnf config-manager --set-enabled PowerTools
  5. On CentOS 8, disable the built-in PostgreSQL module:

    dnf -qy module disable postgresql
  6. Install PostGIS with one of the following platform-specific commands:

    On CentOS 7, to install PostGIS version for EDB Advanced Server version (EPAS) 13.0:

    yum -y install edb-as13-postgis3
    Note

    To install a specific major version of PostGIS, specify the complete version and operating system type. For example to install version 3.0.2 on Advanced Server version 13, the command is yum -y install edb-as13-postgis3-3.0.2.

    On CentOS 8, to install PostGIS version for EDB Advanced Server version (EPAS) 13.0:

    dnf -y install edb-as13-postgis3

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

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

    Where <xx> is the Advanced Server version and <y.y.y> is the PostGIS version you want to install. For example, to install PostGIS 2.5.4 on Advanced Server 12, execute the following command:

    yum -y install edb-as12-postgis-2.5.4

    On CentOS 8, to install PostGIS versions for older versions of EDB Advanced Server:

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

    Where <xx> is the Advanced Server version and <y.y.y> is the PostGIS version you want to install.

    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

You must install Advanced Server before installing PostGIS. For details about installing and configuring Advanced Server, see the EDB Advanced Server Installation Guide available at the EDB website.

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:

  1. To create the repository configuration file, assume superuser privileges and invoke one of the following platform-specific commands:

    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 placeholder 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, execute the following command 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, disable the built-in PostgreSQL module:

    dnf -qy module disable postgresql
  6. Install PostGIS with one of the following platform-specific commands:

    On RHEL 7, to install PostGIS version for EDB Advanced Server version (EPAS) 13.0:

    yum -y install edb-as13-postgis3
    Note

    To install a specific major version of PostGIS, specify the complete version and operating system type. For example to install version 3.0.2 on Advanced Server version 13, the command is yum -y install edb-as13-postgis3-3.0.2.

    On RHEL 8, to install PostGIS version for EDB Advanced Server version (EPAS) 13.0:

    dnf -y install edb-as13-postgis3

    On RHEL 7, to install PostGIS versions for older versions of EDB Advanced Server:

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

    Where <xx> is the Advanced Server version and <y.y.y> is the PostGIS version you want to install. For example, to install PostGIS 2.5.4 on Advanced Server 12, execute the following command:

    yum -y install edb-as12-postgis-2.5.4

    On RHEL 8, to install PostGIS versions for older versions of EDB Advanced Server:

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

    Where <xx> is the Advanced Server version and <y.y.y> is the PostGIS version you want to install.

    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.

    After installing PostGIS with a package manager, please note that 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 placeholder 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
  4. Before installing PostGIS, execute the following command 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 PostGIS version for EDB Advanced Server version (EPAS) 13.0:

    yum -y install edb-as13-postgis3
    Note

    To install a specific major version of PostGIS, for example 3.0.2, for Advanced Server version 13:

    yum -y install edb-as13-postgis3-3.0.2

    To install PostGIS for older versions of EPAS:

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

    Where <xx> is the Advanced Server version and <y.y.y> is the PostGIS version you want to install.

    For example, to install PostGIS 2.5.4 on Advanced Server 12, execute the following command:

    yum -y install edb-as12-postgis-2.5.4

Installing PostGIS on a Debian/Ubuntu Host

You must install Advanced Server before installing PostGIS. For details about installing and configuring Advanced Server, see the EDB Advanced Server Installation Guide available at the EDB website.

To install a 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.

The following steps will walk you through using the EnterpriseDB repository to install a Debian package. When using the commands, replace the username and password with the credentials provided by EnterpriseDB.

  1. Assume superuser privileges:

    sudo su –
  2. Configure the EnterpriseDB repository.

    On Debian 9, Ubuntu 18, and Ubuntu 20:

    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:

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

    Where <xx> is the Advanced Server version and <y.y.y> is the PostGIS version you want to install.

    For example, to install the PostGIS 3.0.2 package for Advanced Server 13, execute the following command:

    apt-get -y install edb-as13-postgis-3.0.2

Installing PostGIS on a SLES 12 Host

You can use the Zypper package manager to install PostGIS on a SLES 12 host. 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. Then, 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 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 Advanced Server Installation Guide for Windows available at the EDB website.

  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 in which 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.

    Then, click Next to continue.

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

  1. 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

  2. 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.