6.4.1 Connecting to a PostGIS database
On the New Data Source page, choose PostGIS as the data source by clicking PostGIS. This will bring you to a New Vector Data Source page. Complete the following steps:
- Select a Service Title from the Workspace drop down menu. Select the workspace you created in the ‘Creating a Workspace’ section
- Type a name for your data store in the Data Source Name field (spaces are acceptable here); add a description if desired
- Make sure that the Enabled checkbox is checked
- Set the Connection Parameters for your PostGIS data source; if the PostGIS data source is located on a remote server, you will need to provide the appropriate host, port, database name, user name, and password to access it:
- Host: use ‘localhost’ if the PostGIS data source is on the same machine as your GeoServer instance; more specific host information will be necessary if your PostGIS data source is on a remote server
- Port: default is 5432
- Database name: this information will depend on the PostGIS data source
- Schema: this information will depend on the PostGIS data source
- User name: this information will depend on the PostGIS data source
- Password: this information will depend on the PostGIS data source
- When finished, click Save.
At this stage you have configured a store of data (a postgis database connection) that is available to your workspace, but you have no actual layers; see section 6.5 for details of how to configure your layers.
Section last modified: 7 October 2015