.. _geoserver.postgis.postgis_install:

Installing PostGIS
------------------

This section covers the installation of PostGIS, the spatial extension for 
PostgreSQL. Version 1.3 of PostGIS will be installed via the PostGIS Windows installer.

#. Navigate to the workshop :file:`software` directory.

#. Run the PostGIS installer by *double-clicking* the file named :file:`postgis-pg82-setup-1.3.3-1.exe`, or alternatively by *right-clicking* on the file and selecting :guilabel:`Open`.

   .. figure:: postgis_install1.jpg

      Running the PostGIS installer

#. Accept the :guilabel:`License Agreement` and click :guilabel:`Next`.

   .. figure:: postgis_install2.jpg

      Reviewing the PostGIS licence agreement

#. Continue through the next two screens accepting the defaults.

   .. figure:: postgis_install3.jpg

      Accepting installation defaults 

   .. figure:: postgis_install4.jpg

      Specifying the install location

#. On the :guilabel:`Database Connection` screen specify the password "postgres" and click :guilabel:`Next`.

   .. figure:: postgis_install5.jpg

      Specifying the PostgreSQL connection information

#. Accept the default database name "postgis", and click :guilabel:`Install`.

   .. figure:: postgis_install6.jpg

      Specifying a database name

#. Finalize the installation and exit the installer.

   .. figure:: postgis_install7.jpg

      Finishing the PostGIS installation

At this point PostGIS should be installed and ready to use. The installation can be verified by starting windows command prompt and executing the command::

    C:\Program Files\PostgreSQL\8.2\bin\psql -U postgres -l

If a database named "template_postgis" is returned in the list then installation was carried out successfully.
