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.
-
From the GSH Dashboard, open your instance’s Product Details page.
-
Under pgAdmin, click Get Password to copy your login credentials.
- Username: Your account email address.
- Password: Copied from page.
-
Click the pgAdmin link to open the interface.
-
Paste your credentials and click Login.
-
After logging in, you’ll see the Object Explorer tree in the left-hand panel.
-
Expand Geospatialhosting Databases → your-server → Databases.
-
Select kartoza_postgis.
This is your preconfigured database for adding tables, geometry fields, and managing spatial data.
Step 2: Create Your Spatial Table¶
Now you’ll create a simple table called places and define its geometry and SRID.
-
In pgAdmin, navigate to kartoza_postgis → Schemas → public → Tables.
-
Right-click Tables, and select Create → Table.
-
On the General tab fill in the following:
Property Value Name places Owner kartoza_postgis Schema public Tablespace pg_default -
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 -
Click Save.
-
Click the Query Tool from the top toolbar.
-
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.
Step 3: Connect to QGIS¶
Once your spatial tables are created in pgAdmin, you can connect your hosted PostGIS database to QGIS.
-
In QGIS, click the Open Data Source Manager.
-
Select PostgreSQL and click New.
-
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 -
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 -
Click Test Connection and OK.
Step 4: Load Your Layer in QGIS¶
Now that your connection is configured, you can add spatial layers from your PostGIS database into QGIS.
-
In the PostgreSQL panel, select your my-postgis connection.
-
Click Connect.
-
Expand the public schema.
-
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.
Step 5: Add Your First Feature¶
You can now start adding and editing features directly from your map.
-
Select the places layer.
-
Click the Toggle Editing button (pencil icon).
-
Click the Add Point Feature tool (map marker icon).
-
Click anywhere on the map to place a point.
-
Fill in the Attribute Form and click OK.
-
Click Toggle Editing again and Save.
Your new point is now safely stored in your hosted PostGIS database.
Step 6: Verify Your Data¶
You can now confirm that your new features have been successfully added to your database.
-
Return to pgAdmin.
-
Expand kartoza_postgis → Schemas → public → Tables → places.
-
Right-click places and select View/Edit Data → All Rows.
You’ll see the features you added from QGIS.
Next up: Discover how to navigate and use the pgAdmin interface to enhance your user experience.