GraphHopper Distance Matrix: Self-Host, API & Alternatives

GraphHopper Distance Matrix: Production Self-Hosting & API Guide How to Call the GraphHopper Matrix API (/matrix Endpoint) Running GraphHopper distance matrix in production requires configuring Docker deployment, the /matrix API endpoint, Custom Models for vehicle-specific routing (truck/motorcycle), H3-based Redis caching, and evaluating performance tradeoffs against OSRM, Valhalla, and Google Maps (for an in-depth analysis of routing engine selection, see our OSRM vs GraphHopper Architecture Comparison). The /matrix endpoint evaluates element-by-element matrix calculations between sets of origin and destination coordinates. When issuing requests, callers specify input point arrays along with requested output arrays such as times (travel duration in seconds) and distances (road distance in meters). Depending on graph preparation, GraphHopper can evaluate matrix queries using speed-optimized Contraction Hierarchies (CH) or flexible Landmark-based (LM) routing models. ...

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

Self-Hosting GraphHopper on Kubernetes with OSM Data

Self-Hosting GraphHopper on Kubernetes with OSM Data 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