GraphHopper Distance Matrix: Self-Host an Open-Source Routing Engine for Production

What Is the GraphHopper Distance Matrix? Answer-first: GraphHopper distance matrix is the /matrix API of the open-source GraphHopper routing engine. It accepts N points and returns an N×N matrix of travel durations (seconds) and distances (meters) based on real road networks from OpenStreetMap — completely free when self-hosted. For 100 delivery stops, it computes 10,000 pairs in under 50ms on a standard VPS. This guide covers everything you need to run GraphHopper distance matrix in production: Docker setup, the /matrix API, Custom Models for truck/motorcycle routing, H3-based Redis caching, and an honest comparison with OSRM, Valhalla, and Google Maps. ...

June 11, 2026 · 11 min · Lê Tuấn Anh