Skip to content

Open Source Routing Machine (OSRM)

C++ routing engine for OpenStreetMap data with an HTTP API for developers

Permissive (OSI) · BSD-2-Clause
  • Self-hosted
  • macOS
  • Linux
  • CLI

Listed by , founder & editor

71

Health

Active

Overview

Stars

8,244

Last commit

yesterday

Nov 2026

Repository age

15 years

since Sep 2011

Latest version

v26.11.0

Nov 2026

Contributors

–

7 active in 90 days

Releases

17

last 12 months

Language

C++

OSRM is a routing engine written in C++ that runs on OpenStreetMap data. You use it through an HTTP API, a C++ library or a NodeJS wrapper. It is a self-hosted alternative to commercial routing APIs.

Services include Nearest, Route, Table for duration or distance matrices, Match for snapping noisy GPS traces to roads, Trip for a greedy Traveling Salesman solution, and Tile for Mapbox Vector Tiles. You download an OSM extract, such as one from Geofabrik, pre-process it with a profile like the car profile, then start the osrm-routed server.

Two pre-processing pipelines exist: Multi-Level Dijkstra, recommended by default, and Contraction Hierarchies, which still suits very large distance matrices. Docker images are provided, and a Homebrew formula covers macOS. It runs on Linux and macOS and is BSD-2-Clause licensed. A separate frontend repository provides a map interface.

Who it's for

Developers adding routing to an app

The HTTP API gives routes, matrices and map matching from your own server.

Skip if: You need live traffic or public transit routing.

Logistics teams computing distance matrices

The Table service and CH pipeline handle large pairwise duration calculations.

Skip if: You need complex vehicle routing with constraints beyond a simple trip solver.

The problem it solves

Commercial routing APIs bill per request and limit bulk use. OSRM lets you run routing on your own hardware with OpenStreetMap data.

Strengths

  • Six services: nearest, route, table, match, trip, tile
  • Official Docker images
  • Two pre-processing pipelines, MLD and CH
  • BSD-2-Clause license
  • Active: 17 releases in the last year

Trade-offs

  • Pre-processing large extracts can take a long time
  • You must prepare OSM data yourself before serving
  • Trip solving uses a greedy heuristic
  • Frontend is a separate repository

Self-host Open Source Routing Machine (OSRM)

Self-hostable
Yes

Quick start

wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf

From the project's own install instructions. Check the docs for production settings.

Frequently asked questions

Is OSRM free?

Yes. It is open source under the BSD-2-Clause license.

Can I self-host it?

Yes. Docker images are provided, and you run osrm-routed on your own server.

Which platforms does it support?

Linux and macOS, with a Homebrew formula, plus Docker.

What data does it use?

OpenStreetMap extracts in .osm.pbf format, for example from Geofabrik.

Similar tools in Maps and navigation

OpenRouteService

Maps and navigation

Self-hosted routing engine for directions, isochrones and matrices on OpenStreetMap data

2k 497 4 days ago Thriving GPL-3.0

OpenStreetMap

Maps and navigation

Ruby on Rails app behind the OpenStreetMap site and editing API, for running your own

2.9k 1.1k today Active GPL-2.0

Replaces Google Maps

TREK

Maps and navigation

Self-hosted collaborative travel planner with maps, bookings, budgets and packing lists

16k 1.4k today Thriving AGPL-3.0

Vela

Maps and navigation

Android maps app on open data for degoogled phones, with no Google account needed

2.8k 157 today Active GPL-3.0

Replaces Google Maps

OpenCPN

Maps and navigation

Cross-platform chartplotter and marine navigation software for boaters at the helm

1.5k 654 today Active GPL-2.0

OpenTripPlanner

Maps and navigation

Self-hosted multimodal trip planner for transit agencies and map app developers

2.8k 1.2k today Active LGPL-3.0