GraphHopper vs OSRM
A side-by-side comparison of two self-hosted maps & gis options — licensing, setup difficulty, resource needs, and what each one replaces.
| Feature | GraphHopper | OSRM |
|---|---|---|
| Deploy effort | Under-an-hour setup | Under-an-hour setup |
| Health score | 83 · Excellent | 92 · Excellent |
| Category | Maps & GIS | Maps & GIS |
| License | Apache-2.0 | BSD-2-Clause |
| Language | Java | C++ |
| Setup difficulty | Medium | Hard |
| Min. RAM | 4,096 MB | 8,192 MB |
| Deployment | docker, bare-metal, binary | docker, bare-metal |
| GitHub stars | ★ 6,701 | ★ 8,103 |
| First released | 2012 | 2012 |
| Replaces | Google Directions API | Google Directions API |
What are GraphHopper and OSRM?
GraphHopper
GraphHopper is an open-source routing engine that calculates routes for cars, bikes, and pedestrians using OpenStreetMap data. It supports turn-by-turn navigation, isochrones, and route optimization.
- Multi-profile routing
- Turn-by-turn navigation
- Isochrones
- Route optimization
OSRM
OSRM, the Open Source Routing Machine, is a fast routing engine for shortest paths in road networks using OpenStreetMap data. It computes routes, travel times, and distance matrices in milliseconds.
- Millisecond routing
- Distance matrices
- Map matching
- Customizable profiles
GraphHopper vs OSRM: key differences
GraphHopper is written in Java, while OSRM is built with C++. Licensing differs — Apache-2.0 for GraphHopper versus BSD-2-Clause for OSRM. GraphHopper is the lighter option, starting around 4,096 MB of RAM against 8,192 MB for OSRM.
Why pick each one
Choose GraphHopper if…
- Released under the Apache-2.0 license
- First-class Docker support for quick deployment
- Mature project with 6.7k GitHub stars
- Written in Java
Choose OSRM if…
- Released under the BSD-2-Clause license
- First-class Docker support for quick deployment
- Mature project with 8.1k GitHub stars
- Written in C++
Frequently asked questions
Is GraphHopper or OSRM better?
Neither is universally better. OSRM has the larger community, while GraphHopper is simpler to set up (medium difficulty). Choose based on the comparison table above and your own setup.
Are GraphHopper and OSRM free and open-source?
Yes. GraphHopper is licensed under Apache-2.0 and OSRM under BSD-2-Clause. Both can be self-hosted at no software cost.
Can I run GraphHopper and OSRM with Docker?
GraphHopper: yes. OSRM: yes.
Which is lighter on resources, GraphHopper or OSRM?
GraphHopper has the smaller minimum footprint at 4,096 MB of RAM, compared to about 8,192 MB for OSRM. Real-world usage depends on library size, user count, and enabled features.