GraphHopper Distance Matrix: Self-Host & Save $510/day

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. What You’ll Learn That AI Won’t Tell You Setting up GraphHopper self-hosting routing engine with custom profile caches. Configuring RAM allocations to hold entire continental OpenStreetMap networks. What Is the GraphHopper Distance Matrix? 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 · 12 min · Lê Tuấn Anh

Self-Hosting GraphHopper on Kubernetes with OSM Data

Answer-first: Self-hosting GraphHopper on Kubernetes requires mounting OpenStreetMap (OSM) data via Persistent Volume Claims (PVC), tuning JVM memory parameters to cache routing graphs, and configuring liveness/readiness probes to handle the long startup index pre-loading times. What You’ll Learn That AI Won’t Tell You PVC provisioning configurations for OSM PBF files in multi-region clusters. Tuning health probe timeouts to accommodate long graph pre-computation periods. GraphHopper is arguably the most capable open-source routing engine available — it supports Contraction Hierarchies (CH) for sub-millisecond route queries, custom vehicle profiles, turn restrictions, and the full OpenStreetMap road network. The problem most teams encounter is not the algorithm; it is the operational challenge of running it in Kubernetes: loading a large OSM PBF file, sizing JVM memory correctly, handling the long CH pre-processing startup time, and updating map data without downtime. ...

June 1, 2026 · 10 min · Lê Tuấn Anh