Running QGIS desktop in a docker container

Posted by: Gavin Fleming | in QGIS | 4 years, 9 months ago | Comments

I love using docker - I have been tracking and learning docker since soon after it was announced and believe it is going to be a real game changer. I've been playing around with the different things one can do in a docker container and of course it is only natural that a 'QGIS guy' such as myself would start to think about using docker with QGIS. QGIS server in a docker container seems like a natural fit, but how about QGIS Desktop? Last night Richard Duivenvoorde and I were sitting around drinking tea and we thought we would give it a quick go - in fact it only took about half an hour to get something working....






I guess the first think you may ask is "why would you want to put QGIS desktop in a docker container?". Well there are actually quite a few good reasons - here is a quick brain dump of reasons why you might want to run QGIS in a docker container:

There are probably a bunch of other good reasons to play with this approach, but the above may be enough to get you curious and play...

Before I show you how to set things up, I should mention there are also some possible downsides:

Setting up

Before you can start you need to do a bit of setup and also note that my scripts provided make a few assumptions - you may wish to edit them to meet your needs. First you need to have docker installed on your OS. Under Ubuntu 14.04 you can simply do:

sudo apt-get install

Next you need to have my Dockerfile 'recipe' for building the docker image. It is available on our github repository (patches and improvements welcome!)

sudo apt-get install git
git clone git://

Now go into the cloned repository and build the image:

cd docker-qgis-desktop

Its going to take a little while to build. After it is done, you should have:

Now reload your desktop (e.g. log out and in again) and look in your applications menu. You should find a new entry called 'QGIS Docker'. Click on it and QGIS should launch.

What happens when I click that icon?

When you click the icon, a little script runs that starts up a new docker container, mounts your home directory into it and starts QGIS, sending its windows back to your deskop. Its all pretty seamless and feels like you are just running a locally installed application.

There are still some gotchas here since this is the first version of our script:

What's next?

Currently we have QGIS 2.4 running in the container. We are going to work on providing the most polished installation possible inside the container. That means adding support for OrpheoToolBox (already added), SAGA, GRASS, MMQGIS, MrSid, ECW, ESRI FGDB etc. etc. that the docker container works 'batteries included' out of the box. If you would like to contribute, please consider forking our repo and submitting a pull request!


Current rating: 4


Template by Blacktie Mezzanine theme by CodingHouse