Installation of PostgreSQL / PostGIS / ArcSDE on Debian/Ubuntu

I found a lot of Installationscripts about some parts of the whole Installationprocess, but as I need the whole thing, I created this HowTo for setting up ArcSDE with PostGIS Support on Debian or Ubuntu.

Install Debian/Ubuntu with ext4 Filesystem because it has more tuning possibilities than ext3 and is basically faster than ext3.[1]

Install PostgreSQL 8.4.7 and PostGIS 1.5.1.[2]

The Postgresql Package automatically creates a new user ‘postgres’, changes its home directory to /var/lib/postgresql/ and stores the current default database (main) in the directory /var/lib/postgresql/8.4/main/. Because of the actual partitions sizes, the /home directory has the most space available, so change the home directory of Postgresql to /home/ and link to /var/lib/ (don’t forget to stop the Server to prevent failures):

Afterwards, edit the postgresql.conf file for the current cluster (f.e. /etc/postgresql/8.4/main/postgresql.conf) to make postgresql listen to all interfaces.

Change the pg_hba.conf (same directory as postgresql.conf) to let clients connect from outside.[3]

And start the PostgreSQL instance afterwards.

The storage of the ArcSDE database can be changed by creating a new directory and setup a new tablespace (see later). Change the permissions to forbid manual edits.

Now log into the PostgreSQL console

At first, create the new role sde.

If a new tablespace is necessary, create it and set the right path.

Now create the new database (Other encodings could result in encoding problems). Set the tablespace if needed.

Grant all privileges to the role sde and allow everyone to connect to the database.

Switch to the new database and install the language ‘plpgsql’, used by some Postgis functions.

Install the Postgis functions in the current database and log into the database again.

Prepare the database for the installation of ArcSDE.

Because ArcSDE uses Postgis functions, it’s necessary to give the sde account access to the public tables of Postgis.

To install ArcSDE, it’s preferable to create a new account to prevent permission escalation.

Create a new directory as installation directory and mount the ArcSDE ISO-File.

The ArcSDE Service search the Socket of the PostgreSQL Instance in the /temp/ directory per default. Because there is no option to change this behavior, it’s necessary to link the run-socket file of PostgreSQL to the temp directory.

ArcSDE 10 needs some extra libraries where some of them are out of date. Install these libraries explicit by downloading and setting up the required packages.

For Debian x86:

For Ubuntu x64:

To bind the ArcSDE service to the port 5151 per default, edit the /etc/services file and add:

Login as user sde and add environment variables in .profile in the users home directory.[4]

Now it’s time to install ArcSDE by executing (as sde user):

Install ArcSDE to /opt/arcsde/.

At first, set the default service name of arcsde by changing the /opt/arcsde/sdeexe100/etc/services.sde file.

To include the required Libraries of ArcSDE in PostgreSQL simply copy the and the (for raster data support) to the library directory of PostgreSQL.

Change some parameters in the /opt/arcsde/sdeexe100/etc/dbinit.sde file.[5]

Setup a new geodatabase to the PostgreSQL database. Don’t forget to create a license and include it in the setup process. Change the permission of the authorization file to prevent others reading the file.

If the storage of raster data is necessary, setup the required table entries.[6]

To start/stop/list the ArcSDE Status, use the binary sdemon.[7]

To alter settings of the ArcSDE Instance, use the binary sdedbtune. Change the geometry storage type to postgis geometry and the raster storage type to the raster type of arcsde (default is binary).

Based on the guide at there are some tuning options.

In postgresql.conf

On Linux setting shared_buffers to large values requires to adjust some kernel parameters.[8] Add the parameters to /etc/sysctl.conf to make it permanent.

Restarting postgresql is required to make changes affect. Use sudo sysctl -a | grep shmmax to determine the systems current shmmax value.

Depending on the SHMMAX value, it might also be needed to adjust SMALL. SHMALL is given in pages and should at least be SHMMAX / PAGE_SIZE. The page-size on a linux system can be determined with the command getconf PAGESIZE. However on a standard debian i386 System SHMALL is set to 2097152 (= 8GB), so no need to modify it.

For further instructions in working with ArcSDE, the ArcSDE Admin Command reference can be found at

2 thoughts on “Installation of PostgreSQL / PostGIS / ArcSDE on Debian/Ubuntu”

  1. Hey, wondering how this has worked out for you? Have you upgraded to newer versions of ArcGIS SDE or newer versions of Postgres and PostGIS?


    1. No, I didn’t upgraded so far. Unfortunately, I’m no more working with PostGIS / Geodatabases because I switched job. But I know that there might be problems with the library versions. so be carefull, if you try to update! Maybe you can post, if you were successfull in upgrading ArcSDE.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.