Public | Automated Build

Last pushed: 22 days ago
Short Description
Short description is empty for this repo.
Full Description

QGIS Server for Docker

A simple docker container that runs QGIS Server

This image uses the QGIS Desktop docker image as its base.

Please see the canonical documentation
for QGIS Server if you need more general info on how QGIS Server works.

Note You should revise the security
etc. of this implementation before using in a production environment.



QGIS Server documentation

Please see the canonical documentation
for QGIS Server if you need more general info on how QGIS Server works.


To use the image, either pull the latest trusted build from by doing this:

docker pull kartoza/qgis-server:LTR

Note that the LTR build will always track the most recent QGIS Long
Term Release build.

We use versioned images and highly recommend that you track a specific
version for your orchestrated services since things may break between

In this repository you will find a subdirectory for each QGIS version
supported. Each directory contains a self contained docker project
and we will maintain all the versioned builds from these containers.

You can build the image yourself like this:

git clone git://
cd docker-qgis-server/2.14
docker build -t kartoza/qgis-server .

To run a container do:

docker run --name "qgis-server" -p 9999:80 -d -t kartoza/qgis-server

NOTE: Again we would like to recommend you run a tagged version rather
than just the latest since your configuration may break if we change something.

Example use with docker compose

Here is a contrived example showing how you can run QGIS Server
from in a docker container using docker-compose. Example docker-compose follows:

  image: kartoza/postgis:9.4-2.1
    - USERNAME=docker
    - PASS=docker

  image: kartoza/qgis-server:2.18.10
  hostname: qgis-server
    # Wherever you want to mount your data from
    - ./web:/web
    - db:db
    - "80801:80"

To run the example do:

docker-compose up

You should see QGIS server start up. For more detailed approaches
to using and building the QGIS Server container, see below.

Note: The database in the above example is stateless (it will be deleted when
running docker-compose rm). If you want to connect to the PG database from docker
use the following info:

  • host: db
  • database: gis
  • user: docker
  • password: docker

Apache environment variables

Apache will make of the following environment variables. You can
tweak these by replacing these options in your docker-compose.yml
or docker run command.

APACHE_CONFDIR /etc/apache2
APACHE_RUN_DIR /var/run/apache2
APACHE_LOCK_DIR /var/lock/apache2
APACHE_LOG_DIR /var/log/apache2

The following variables (with defaults shown) are QGIS specific
options you can tweak by replacing these options in your docker-compose.yml
or docker run command.

QGIS_LOG_FILE /proc/self/fd/1
QGIS_SERVER_LOG_FILE /proc/self/fd/1
PGSERVICEFILE /project/pg_service.conf
QGIS_PROJECT_FILE /project/project.qgs
QGIS_PLUGINPATH /opt/qgis-server/plugins

Probably you will want to mount the /project folder with local volume
that contains some QGIS projects. As you can see above, if no project
file is specified, QGIS will try to serve up /projects/project.qgs by
default so if you are looking for an easy to share WMS/WFS url, simply
call your project file project.qgs and mount it in the /project

./; docker kill server; docker rm server;
docker run --name="qgis-server" \
    -d -p 9999:80 \
 docker logs qgis-server

Replace <path_to_local_qgis_project_folder> with an absolute path on your
filesystem. That folder should contain the .qgs project files you want to
publish and all the data should be relative to the project files and within the
mounted volume. See for an example
of a project layout that we use to power

An example project folder is provided here for convenience (and we
use it for validation testing).

Accessing the services:

Simply entering the URL of the docker container with its port number
will respond with a valid OGC response if you use this url in QGIS
'add WMS layer' dialog.


Tim Sutton ( - May 2014


During the Girona QGIS hackfest in 2016, Patrick Valsecchi did an
almost complete re-write of this image recipe which I have heavily
based this and the recipe in docker-qgis-desktop on. Thanks Patrick!

Docker Pull Command
Source Repository