2015-12-15 15:40:39 +00:00
|
|
|
---
|
|
|
|
layout: page
|
|
|
|
title: Serve Vector Tiles
|
|
|
|
published: true
|
|
|
|
---
|
|
|
|
|
2015-12-15 15:00:38 +00:00
|
|
|
# Serve Vector Tiles
|
|
|
|
|
|
|
|
We provide a free and fast CDN for accessing the vector tiles.
|
|
|
|
But you have the choice to self host the vector tiles if you want to.
|
|
|
|
|
|
|
|
For serving vector tiles we recommend using
|
2015-12-18 16:29:59 +00:00
|
|
|
[tileserver-php from Klokan Technologies](https://github.com/klokantech/tileserver-php)
|
2015-12-15 15:00:38 +00:00
|
|
|
which supports serving MBTiles containing vector tile PBFs out of the box.
|
|
|
|
|
2015-12-17 14:27:00 +00:00
|
|
|
## Apache
|
|
|
|
|
2015-12-15 15:00:38 +00:00
|
|
|
### Installation
|
|
|
|
|
2015-12-17 14:40:30 +00:00
|
|
|
If you have an Apache webhosting follow the
|
|
|
|
[installation instructions](https://github.com/klokantech/tileserver-php#installation) to set up tileserver-php on your server.
|
2015-12-15 15:00:38 +00:00
|
|
|
|
|
|
|
### Download MBTiles
|
|
|
|
|
2015-12-17 14:27:00 +00:00
|
|
|
1. On the server [download your desired extract of a country or the
|
|
|
|
entire world MBTiles](/downloads).
|
|
|
|
2. Put it in the public folder `/var/www/` and you are good to go.
|
2015-12-15 15:00:38 +00:00
|
|
|
|
2015-12-17 14:27:00 +00:00
|
|
|
## Docker
|
2015-12-15 15:00:38 +00:00
|
|
|
|
2015-12-17 14:40:30 +00:00
|
|
|
You can also run tileserver-php with Docker.
|
2015-12-15 15:00:38 +00:00
|
|
|
|
|
|
|
Pull down the latest image.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
docker pull klokantech/tileserver-php
|
|
|
|
```
|
|
|
|
|
|
|
|
And mount the directory with the MBTiles to the public folder.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
docker run -v $(pwd):/var/www -p 80:80 klokantech/tileserver-php
|
|
|
|
```
|