# Using Mapbox Studio (aka Tilemill 2) to create a self-hosted map

What would be the neccessary prerequisites to run a map/tile-server (serving raster tiles) using an exported vector source and tm2z-styleset?

Has anyone set up a working environment for that?

Is Tessera a possible package for such a case?

• I wouldn’t see this as a direct duplicate, since my question is not only about hosting vector tiles. – Alexander Rutz Dec 15 '14 at 7:16
• Reading the tilelive-vector readme it sounds like tilelive might be able to render raster tiles from vector source with a tm2z-live-package. However it doesn’t explicitly mention any rendering, which makes me wonder if something else is needed? Any experiences someone? – Alexander Rutz Dec 15 '14 at 10:21

## 3 Answers

Yes. tessera was built for exactly this use-case. See tilelive-tmstyle.

To run, first make sure that your tm2 project.yml file points at a local source (e.g. mbtiles:///path/to/archive.mbtiles), then:

 npm install tessera tilelive-tmstyle mbtiles node_modules/.bin/tessera tmstyle:///path/to/project.tm2 

• Cheers. Still have to try this. Looks very promising! – Alexander Rutz Apr 23 '15 at 9:05
• The "Points to local source" has been a good gotcha for me, thanks for noting. – Kyle Hotchkiss Jun 14 '15 at 17:32

Not sure if that fits to your use case, but I managed to self-host my exported vector tile source with tilelive and consume the vector tiles with Mapbox GL JS. See my answer to my related question. Styling is done in Mapbox GL format not with tm2z.

• Cheers! The Mapbox-GL-JS solution is one possible, and a very interesting solution for my problem. However, compatibility is still an issue at this point. The other way would be to host either Postgis/GeoJSON/Vector Tiles plus a rendering server for raster tiles. I still haven’t found a straight-forward way to do this. It could be involving tilelive. Tessera sounds very interesting, I was also hoping someone has any experience using it. – Alexander Rutz Dec 15 '14 at 7:16
• I'm' confused - maybe mapbox has prevented users from exporting mbtiles since this thread? My only option in mapbox studio is to download a package of the format tm2z – mheavers Sep 24 '15 at 22:06
• @mheavers You tried to download a style (which is stored in a .tm2z file). Instead you should export a source. To do that, in menu point Styles & Sources (lower left corner) switch to Sources. Create or load a source and in menu Settings do Export to MBTiles. – Andreas Bilger Oct 29 '15 at 20:04
• @andreas bilger - Thanks - yes I finally figured that out. I think I'm confused now as to how to create a source. Is it not possible to export an existing mapbox source? I do not have any sort of GIS experience, and am not sure where to go for open data. – mheavers Oct 30 '15 at 20:23
• @mheavers No, I think it is not possible to export an existing mapbox source. (See Dan's answer to your other question) The most famous example of open data is probably OpenStreetMap. Geofabrik provides extracts in .shp format that can be used with Mapbox Studio. – Andreas Bilger Nov 1 '15 at 14:30

tileserver-gl-light is also a recommended server from osm2vectortiles.org