Public Repository

Last pushed: 2 years ago
Short Description
based on homme/openstreetmap-tiles-docker
Full Description

OpenStreetMap Tile Server Container

based on homme/openstreetmap-tiles-docker
source at

This repository contains instructions for building a
Docker image containing the OpenStreetMap tile
serving software stack. It is based on the
Switch2OSM instructions.

The tiles are styled using OSM Bright.

As well as providing an easy way to set up and run the tile serving software it
also provides instructions for managing the back end database, allowing you to:

  • Create the database
  • Import OSM data into the database
  • Drop the database

Run docker run haroldship/openstreetmap-tiles-docker for usage instructions.


The container runs Ubuntu 14.04 (Trusty) and is based on the
phusion/baseimage-docker. It

  • Postgresql 9.3
  • Apache 2.2
  • Osm2pgsql from Oct 22 (24e4d4bf273aaf3572fda11d2c0b32aa3156f84a)
  • The latest Mapnik code (at the time of image creation)
  • The latest Mod_Tile code (at
    the time of image creation)
  • The latest OSM Bright code (at the
    the time of image creation)


This is a work in progress and although generally adequate it could benefit
from improvements. Please
submit issues
on GitHub. Pull requests are very welcome!

Getting Started

These instructions are for linux only, and assume that Docker is up and running.

  1. Make a working directory.

     mkdir osm
     cd osm
  2. Make a directory to contain the import file.

     mkdir import
     cd import
  3. Download the import file. You can use any OSM PBF file, but it is important to name it import.pbf.

     curl -o import.pbf
  4. Move back to working directory.

     cd ..
  5. Run the image, with help.

     docker run -it haroldship/openstreetmap-tiles-docker help
  6. If everything goes well, then there are 3 steps:

    • Initial setup, which includes creating the database and user
    • Importing
    • Running
  7. Initialize:
    It is important to get the path to the PostgreSQL data directory correct.

     mkdir data
     docker run -v $PWD/data:/var/lib/postgresql \
     -it haroldship/openstreetmap-tiles-docker \
     initdb startdb createuser createdb
  8. Import:
    It is important to get the path to the import directory correct.
    This step can take a long time, depending on how large a database you are importing.

     docker run -v $PWD/import:/data -v $PWD/data:/var/lib/postgresql \
     -it haroldship/openstreetmap-tiles-docker startdb import
  9. Start the services.

      docker run -v $PWD/data:/var/lib/postgresql \
     -d -P haroldship/openstreetmap-tiles-docker startdb startservices
Docker Pull Command