Somaire
1. Prerequisites & resources
- Ubuntu 24.04 “Noble” up to date (kernel 6.8)
- Docker ≥ 25 or Node ≥ 18.17 (Node 22 recommended by MapTiler)
- 4 vCPU, 8 GB RAM minimum; NVMe SSD for optimal disk throughput
- An OpenMapTiles *.mbtiles* file (e.g. France = ~7 GB)
2. Docker Method (recommended)
2.1 Install Docker & pull the image
sudo apt update && sudo apt install docker.io -y
sudo docker pull maptiler/tileserver-gl:latest
The official image includes MapLibre GL Native and handles on-demand PNG/JPEG/WEBP rasterization
2.2 Download a vector tileset
wget -P ~/data https://download.openmaptiles.com/osm/v3.15/europe/france.mbtiles
OpenMapTiles provides paid or free tilesets depending on the area
2.3 Launch TileServer GL
cd ~/data
docker run -it -d --name tileserver
-p 8080:8080 -v $(pwd):/data
maptiler/tileserver-gl
--port 8080 --public_url https://example.com
The server auto-detects *.mbtiles* files in /data and serves /styles/, /tiles/ and a MapLibre viewer
2.4 Verification
- Vector tiles:
http://IP:8080/data/v3.json - WMTS:
http://IP:8080/styles/bright/wmts.xml - MapLibre Preview:
http://IP:8080/
3. npm Method (native installation)
sudo apt install build-essential nodejs npm -y
sudo npm install -g tileserver-gl
Make sure Node ≥ 18; MapLibre binaries are now compiled for even-numbered LTS versions
tileserver-gl france.mbtiles --port 8080
4. Optimizations & best practices
- HTTP Cache: add
Cache-Control: max-age=86400, immutablebehind Nginx or Traefik. - Raster pre-rendering: avoid on-the-fly PNG generation under heavy load; generate static tiles if needed
- WMTS for desktop GIS; available at
/wmts.xml - tileserver-gl-light: lighter if you only serve vector tiles without PNG rendering
5. Automatic update of .mbtiles
To keep up with OSM changes, you can:
- Re-download the monthly OpenMapTiles extract and replace the file
- Or generate your own tiles via the OpenMapTiles pipeline (Docker Compose)
A simple docker restart tileserver reloads new tiles thanks to TileServer GL’s automatic scanning
6. Security & production
- Nginx proxy with Let’s Encrypt for TLS (ports 80 / 443)
- Limit
/datato read-only via-v $(pwd):/data:ro - UFW: expose only 8080 internally, 80/443 publicly
- Monitor Docker logs and enable
--restart unless-stopped
7. Quick Troubleshooting
If the server stops after a request, check the Node version or GPU driver; several GitHub issues report crashes with Node < 18 and certain virtual drivers