Skip to content
The OpenStreetMap Tile Server in a Docker container
Branch: master
Clone or download
Pull request Compare This branch is 20 commits ahead of ncareol:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.dockerignore Adapt documentation + add docker-compose May 10, 2017
Dockerfile Dockerfile : avoid munin cron tasks and associated logs Jun 15, 2017
LICENSE add direct usage Jun 15, 2017
docker-compose.yml add direct usage Jun 15, 2017


This is a Docker image that provides a full stack for working w/ OpenStreetMap data. It can be used to:

  • Initialize PostgreSQL database w/ PostGIS extensions: initdb
  • Import OpenStreetMap data into PostgreSQL database: import
  • Optionally pre-generate tiles: render
  • Serve pre-generated (if available) and dynamically generated tiles from Apache, renderd and mapnik via a Leaflet interface: startservices
  • Serve exclusively pre-generated tiles from Apache via a Leaflet interface: startweb


This image is adapted from ncareol/osm-tiles-docker, which is based on homme/openstreetmap-tiles-docker, which is based on the Switch2OSM instructions.

It runs Ubuntu 16.04 (Xenial) and is based on phusion/baseimage-docker. It includes:

  • PostgreSQL 9.5
  • PostGIS extensions
  • Apache 2.4
  • osm2pgsql
  • mapnik
  • openstreetmap-carto, a CartoCSS template (mapnik style) for OpenStreetMap data
  • mod_tile, an Apache module that also provides scripts for rendering tiles


To build this image:

$ docker build -t zavpyj/osm-tiles .

Command reference is available in help.txt or by running the image:

$ docker run --rm zavpyj/osm-tiles

Atomic Usage

To persist the postgresql database and the generated tiles, it is advised to create beforehand a docker's named volume (mandatory to persist on Windows OS):

$ docker volume create --name nvpostgisdata -d local
$ docker volume create --name nvtiles -d local

Using Docker Compose and a dedicated docker-compose.yml configuration file, zavpyj/osm-tiles is even simpler to use:

$ docker-compose run --rm app-osm initdb
$ docker-compose run --rm app-osm import
$ docker-compose run --rm app-osm render
$ docker-compose up -d

Direct Usage

Initialise if not already done (initdb+import+render) and Start OSM server (startservices)

$ docker-compose -f osm.yml up -d
You can’t perform that action at this time.