Skip to content

Quickstart: 5-Minute Tutorial

This short tutorial shows you how to access your hosted PostGIS database, create your first spatial table, connect it to QGIS, and start editing features, all in just a few steps.


Step 1: Access Your Database

pgAdmin is the web interface included with every hosted PostGIS instance. It lets you explore your database, create spatial tables, and run SQL queries.

  1. From the GSH Dashboard, open your instance’s Product Details page.

  2. Under pgAdmin, click Get Password to copy your login credentials.

    • Username: Your account email address.
    • Password: Copied from page.


  3. Click the pgAdmin link to open the interface.

  4. Paste your credentials and click Login.

  5. After logging in, you’ll see the Object Explorer tree in the left-hand panel.

  6. Expand Geospatialhosting Databases → your-server → Databases.

  7. Select kartoza_postgis.


This is your preconfigured database for adding tables, geometry fields, and managing spatial data.


pgAdmin tree
Image credit: pgAdmin


Step 2: Create Your Spatial Table

Now you’ll create a simple table called places and define its geometry and SRID.

  1. In pgAdmin, navigate to kartoza_postgis → Schemas → public → Tables.

  2. Right-click Tables, and select Create → Table.

  3. On the General tab fill in the following:


    Property Value
    Name places
    Owner kartoza_postgis
    Schema public
    Tablespace pg_default


  4. Open the Columns tab and add:


    Name Data Type Length Not Null? Primary Key?
    id integer x x
    name character 256 x
    geometry geometry x


  5. Click Save.

  6. Click the Query Tool from the top toolbar.

  7. Run the following command into the SQL Editor:


    ALTER TABLE places
    ALTER COLUMN geometry TYPE geometry(Point, 4326)
    USING ST_SetSRID(geometry, 4326);
    


You’ve now created a spatial table in your database that can store point-based geographic features.


Create Table
Image credit: pgAdmin


Step 3: Connect to QGIS

Once your spatial tables are created in pgAdmin, you can connect your hosted PostGIS database to QGIS.

  1. In QGIS, click the Open Data Source Manager.

  2. Select PostgreSQL and click New.

  3. Fill in the connection details:


    Property Value
    Name my-postgis
    Host your-product-name.sta.geospatialhosting.com
    Port 5432
    Database kartoza_postgis
    SSL Mode Require


  4. Under Authentication, click the + button and fill in the following:


    Property Value
    Name my-postgis
    Username kartoza_postgis
    Password Copy from the Product Details page


  5. Click Test Connection and OK.


New Connection
Image credit: pgAdmin


Step 4: Load Your Layer in QGIS

Now that your connection is configured, you can add spatial layers from your PostGIS database into QGIS.

  1. In the PostgreSQL panel, select your my-postgis connection.

  2. Click Connect.

  3. Expand the public schema.

  4. Select the places layer and click Add.


Your PostGIS layer now appears in the QGIS Layers Panel and can be styled, queried, or edited like any other layer.


Load Layer
Image credit: pgAdmin


Step 5: Add Your First Feature

You can now start adding and editing features directly from your map.

  1. Select the places layer.

  2. Click the Toggle Editing button (pencil icon).

  3. Click the Add Point Feature tool (map marker icon).

  4. Click anywhere on the map to place a point.

  5. Fill in the Attribute Form and click OK.

  6. Click Toggle Editing again and Save.


Your new point is now safely stored in your hosted PostGIS database.


Attribute Form
Image credit: pgAdmin


Step 6: Verify Your Data

You can now confirm that your new features have been successfully added to your database.

  1. Return to pgAdmin.

  2. Expand kartoza_postgis → Schemas → public → Tables → places.

  3. Right-click places and select View/Edit Data → All Rows.


You’ll see the features you added from QGIS.


Update Table
Image credit: pgAdmin



Next up: Discover how to navigate and use the pgAdmin interface to enhance your user experience.