[qgis-qwc2] How to use custom CRS in QWC2

Benjamin Cahill bcahill at alertacademy.com
Mon Jan 5 05:03:24 PST 2026


Sandro,

I changed the docker-compose configuration to mount the qgis.db file
at /etc/qgis.db and now it works as expected.

Thank you very much for your help! I hope you have a great new year.

 - Benjamin


On Mon, Jan 5, 2026 at 3:09 AM Sandro Mani <manisandro at gmail.com> wrote:
>
> Hello
>
> The projections defined in the viewer config.json do not affect the server, they are used only by the viewer.
>
> If you want to add custom projections to the server, then changing the profile `qgis.db` should be the way to go. If you set QGIS_SERVER_LOG_LEVEL: 0, you should see in the log output which db is being read, likely it is /etc/qgis.db.
>
> Hope this helps
> Sandro
>
> On 30.12.25 21:34, Benjamin Cahill via qgis-qwc2 wrote:
>
> Hello,
>
> I am struggling to get a custom CRS working with QWC2. I added it in
> config.json -> projections and it shows up in the web viewer as
> expected, but every request to QGIS Server results in a 400 bad
> request error and this error in the logs:
>
>  <ServiceException code="InvalidCRS">The CRS is not valid.</ServiceException>
>
> It doesn't seem that the QGIS Server docker container is aware of the
> custom CRS. I reviewed the docker volume mounts and none of them would
> inform QGIS Server of the custom CRS (unlike qwc-map-viewer which
> mounts /config which includes /default/mapViewerConfig.json where the
> projections are put once the config is generated).
>
> I noticed that the qwc-qgis-server container has qgis.db and srs.db
> files in /usr/share/qgis/resources. I tried copying the qgis.db from
> my desktop computer and mounting it as a volume to replace the
> /usr/share/qgis/resources/qgis.db file, but that didn't help either.
>
> What is the right way to add a custom CRS to the qwc-qgis-server container?
>
> I could try editing the srs.db file directly or making a copy and
> mounting it, but I don't know if that is the best solution.
>
> Thank you for any help!
>
>  - Benjamin
> _______________________________________________
> qgis-qwc2 mailing list
> qgis-qwc2 at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/qgis-qwc2


More information about the qgis-qwc2 mailing list