Was hoping I could just extract tiles into a local file system, point IIS at it and be done but I guess that is not the reality of Open Street Map. I'm getting buried in all the possible ways of self-hosting OSM tiles but unable to find simple step-by-step instructions. I've identified PostgreSQL, PostGIS, Mapnik as key players but can't get all the pieces together. Any step-by-step instructions on creating a custom OSM tile server?


4 Answers 4


switch2osm will give you some directions to go as far as serving OSM tiles.

Two caveats:

  • Only 0.01% of people actually should do this. Think about using OSM's tiles, or MapQuest Open, or MapBox. Hosting your own tiles will take at least a week's work.
  • Using Windows for this will be a losing battle. Don't.
  • Thanks for the warning -- I'm looking into getting a linux box but perhaps I'm on the wrong track. Can you elaborate on why this is only for 1:1000 people? Are you suggesting I start accessing tiles from http://*.tile.openstreetmap.org or http://*.mqcdn.com/tiles/1.0.0/osm or http://*.tiles.mapbox.com/v3/mapbox.mapbox-streets
    – ca0v
    Commented Apr 17, 2012 at 13:33
  • NOTE: mod_tile is unix only
    – ca0v
    Commented Apr 17, 2012 at 19:06
  • 1
    Rendering your own tiles means maintaining a copy of the data, which is enormous, and setting up the software, which is complex and barely documented. Then maintaining it, styling, etc. There isn't much reason to go through this unless you want extreme styling flexibility - and if you just want moderate styling flexibility there's MapBox custom maps or CloudMade's custom tiles.
    – tmcw
    Commented Apr 17, 2012 at 20:23
  • Note to others: I invested 16 hard hours into a painful setup process and was disappointed to not find a just-in-time tiling solution. BUT I am now able to quickly generate city-level maps on my windows box without worrying about the availability of outside services. For example, I was able to generate a Greenville, SC map (levels 0-19) in under an hour. I had to use an ancient version of proj.4 and forgo mod_tile but in the end I have my tiles.
    – ca0v
    Commented Apr 18, 2012 at 14:19

I know that this isn't a direct answer but since I am currently working on this I haven't completed my workflow. Here are a few useful articles and tools that might help you:

osm2pgsql Benchmarks - some interesting benchmarks on osm2pgsql (the tool you would use to import to your PostGIS database)

osmfilter - Used for filtering features from the .osm file. This should make insertion into your database much easier

osmconvert - Used for converting either .pbz or .osm files to .o5m format which has the following benefits

  • small file size

  • fast processing

  • flat hierarchy, processable as data stream

  • easy merging of two or more files

  • user may choose compressing method and compress the file

osm2pgsql - used to load to your PostGIS

I am currently working off an Amazon EC2 Instance so if you are interested I can update you on my progress.

  • Yes, certainly I'm interested in anything that will help document this process. Perhaps updating this answer along the way will be most beneficial. Thank you for your time and answer.
    – ca0v
    Commented Apr 16, 2012 at 18:08

This guy from Boston GIS has a great step by step article which shows how to load data into PostGIS:

Loading OSM to Postgis

  • Setup was not a fun process even with this as a guide but it's possible to pre-generate tiles using generate_tiles.py -- biggest issue I had was with incorrect PATH VARS after non-default install and getting mapnik2.0rc0 + proj.4 + python 2.7 on the path without conflicts from older versions of the same.
    – ca0v
    Commented Apr 17, 2012 at 20:02
  • I was actually using TileMill (mapbox.com/tilemill), it was pretty fast, now I'm stuck with trying to get the Cartography displaying correctly in TileMill!
    – Khattab
    Commented Apr 17, 2012 at 20:10

It's now probably a bit late, but have you tried Maperitive Tutorial: A Hiking Web Map In Ten Easy Steps. I can guarantee you wouldn't loose 16 hours on this.

I also suggest using Leaflet.js instead of OpenLayers, it's much easier to work with (I'll update the tutorial once Maperitive 2.0 is officially out).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.