QGIS Webclient (QWC2) ¶
The QGIS Web Client 2 (QWC2) service provides a modern, responsive web application for visualizing and interacting with QGIS projects. It allows users to publish geospatial data stored in the infDB database to the web, offering capabilities such as layer management, feature information, searching, and map printing. More information can be found on the official Github Repo.
Configuration¶
The configuration is managed via environment variables:
# ==============================================================================
# SERVICE ACTIVATION
# ==============================================================================
# Select profiles to activate
COMPOSE_PROFILES=...,qwc,... # (1)
# ==============================================================================
# QWC2 SEVICE
# ==============================================================================
# Profile: qwc
# Port on which the QWC2 is available on the host machine
SERVICES_QWC_EXPOSED_PORT=8088 # (2)
- Activate service: The
qwcprofile must be included to activate the QWC service. - Port: The port on which QWC2 is available.
Access¶
If you activate the service, it should be available on the default port SERVICES_QWC_EXPOSED_PORT=8088 via your browser:
http://localhost:8088
http://IP-ADDRESS-OF-HOST:8088
Setup and Usage¶
Server Setup¶
Get Configuration Files¶
git clone https://gitlab.lrz.de/tum-ens/need/infdb.git
cp -r database/tools/qgis_webclient/ qwc
rm -r database
Configure Database Connection¶
Edit qwc/pg_service.conf to set your geodatabase connection details:
[qwc_configdb]
host=qwc-postgis
port=5432
dbname=qwc_services
user=qwc_admin
password=qwc_admin
sslmode=disable
[qwc_geodb]
host=qwc-postgis
port=5432
dbname=qwc_services
user=qwc_service_write
password=qwc_service_write
sslmode=disable
[infdb_postgres]
host=postgres
port=5432
dbname=infdb
user=infdb_user
password=infdb
Generate JWT Secret¶
Set User and Group IDs¶
In qwc/docker-compose.yml, update SERVICE_UID and SERVICE_GID to match the UNIX user owning the config files:
Start Services¶
Then generate service configuration via the admin interface (default credentials: admin/admin) at http://[ip_address]:8088/qwc_admin/.
Publishing Projects¶
- Create and save a QGIS project (
.qgzformat) - Upload to the server:
- Open the admin interface and generate the service configuration
Local Setup¶
Create pg_service.conf with the same database connection details and add its path to the PGSERVICEFILE environment variable. This allows you to develop projects locally using the same data source as the server.