NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hi all,

I am aware of TileMill, however, I need a library or tool that can take osm data (from a URL, rather than a local file source) and return an MBTiles file. I would like to create my own application where the user can view an area on the map (I plan on using OpenLayers + data from OpenStreetMap) and upon selection of an area, the application can call this tool/library and an MBTiles file can be generated and saved locally. I would then use this MBTiles file to display a map to the user when he/she is off-line.

Does such a tool/library exist? Can TileMill offer this functionality via an API?

Thank you,


asked 30 Mar '12, 06:24

fabasi's gravatar image

accept rate: 0%

edited 30 Mar '12, 06:25

It looks like you will either have to download the files first and then use mbutil to make an MBTiles file, or you will have to modify that utility to read from the web instead of from a file.

Be aware that while it is ok to use data from OpenStreetMap for your purpose, it is not acceptable that you use the OSM-provided tile server; you will have to set up your own tile server for that. See Tile Usage Policy.

permanent link

answered 30 Mar '12, 07:17

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
accept rate: 23%

Thanks for the answer; that makes sense. I would be happy to setup my own tiles server, if that is what is needed. So in that case, would I download all the data from osm (periodically?), and host that on my own server? What is required to setup a tiles server? I think that an "enhanced" tiles server which generates MBTiles files is essentially what I am trying to build for the project described above.



(30 Mar '12, 07:50) fabasi

Well, planet.osm if 29GB (400GB uncompressed XML) so if possible start from a smaller part; see

(09 Jul '14, 22:41) sesam

You can create MBTiles from any .osm.pbf file using this tool -

  1. Download .osm.pbf file from Geofabric. To download for a custom area, you can use Protomaps or BBBike Extract

  2. Download tilemaker

  3. Execute the following command

tilemaker --input netherlands.osm.pbf --output netherlands.mbtiles --process resources/process-openmaptiles.lua --config resources/config-openmaptiles.json

You can read more about it in this blog post -

permanent link

answered 19 Aug '21, 19:48

protos29's gravatar image

accept rate: 0%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 30 Mar '12, 06:24

question was seen: 12,222 times

last updated: 19 Aug '21, 19:48

NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum