Installation

This is a basic guide to download and install pgRouting.

Additional notes can be found in Installation Notes

Also PostGIS provides some information about installation in this Install Guide

Download

Binary packages are provided for the current version on the following platforms:

Windows

Winnie Bot Builds:

Production Builds:

Ubuntu/Debian

Ubuntu packages are available in Launchpad repositories:

# Add pgRouting launchpad repository ("stable" or "unstable")
sudo add-apt-repository ppa:georepublic/pgrouting[-unstable]
sudo apt-get update

# Install pgRouting packages
sudo apt-get install postgresql-9.1-pgrouting

Use UbuntuGIS-unstable PPA to install PostGIS 2.0.

RHEL/CentOS

  • Add repositories for dependencies:

    wget http://repo.enetres.net/enetres.repo -O /etc/yum.repos.d/enetres.repo
    wget http://nextgis.ru/programs/centos/nextgis.repo -O /etc/yum.repos.d/nextgis.repo
    yum install epel-release
    
  • Install PostgreSQL and PostGIS according to this instructions.

  • Install CGAL:

    yum install libCGAL10
    
  • Install pgRouting:

    yum install pgrouting_94
    

More info (and packages for CentOS) can be found here.

FreeBSD

pgRouting can be installed via ports:

cd /usr/ports/databases/pgRouting
make install clean

OS X

  • Homebrew
brew install pgrouting

Source Package

You can find all the pgRouting Releases:

https://github.com/pgRouting/pgrouting/releases

See Build Guide to build the binaries from the source.

Using Git

Git protocol (read-only):

git clone git://github.com/pgRouting/pgrouting.git

HTTPS protocol (read-only):

git clone https://github.com/pgRouting/pgrouting.git

See Build Guide to build the binaries from the source.

Installing in the database

pgRouting is an extension.

CREATE EXTENSION postgis;
CREATE EXTENSION pgrouting;

Upgrading the database

To upgrade pgRouting to version 2.1.0 use the following command:

ALTER EXTENSION pgrouting UPDATE TO "2.1.0";