Install TileServer GL & OpenMapTiles on Ubuntu 24.04

Evaluez cet article !
[Total: 0 Moyenne : 0]

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, immutable behind 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
Lire aussi  Choosing the Best Data Agency: Focus on Keyrus and Its Alternatives

5. Automatic update of .mbtiles

To keep up with OSM changes, you can:

  1. Re-download the monthly OpenMapTiles extract and replace the file
  2. 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 /data to 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

Evaluez cet article !
[Total: 0 Moyenne : 0]
Julie - auteure Com-Strategie.fr

Julie – Auteure & Fondatrice

Étudiante en journalisme et passionnée de technologie, Julie partage ses découvertes autour de l’IA, du SEO et du marketing digital. Sa mission : rendre la veille technologique accessible et proposer des tutoriels pratiques pour le quotidien numérique.

Leave a comment