selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

Open Source Routing Machine (OSRM) logo

Self-host Open Source Routing Machine (OSRM)

v26.11.0

C++ routing engine for OpenStreetMap data

ReleaseOpen SourceBSD-2-Clause
docker run -t -v "${PWD}:/data" ghcr.io/project-osrm/osrm-backend osrm-extract -p /opt/car.lua /data/berlin-latest.osm.pbf || echo "osrm-extract failed"
Updatedlast week
LanguageC++
Setup difficultyModerate
Stars
8 197
Port
5000 (osrm-routed HTTP routing API)
Docker
ghcr.io/project-osrm/osrm-backend
Open Source Routing Machine (OSRM) screenshot 1

What is Open Source Routing Machine (OSRM)?

OSRM is a road-routing engine written in C++ that turns OpenStreetMap data into a queryable service aimed at developers building navigation, logistics or geo applications. The self-hosted server osrm-routed exposes six HTTP services - route, nearest, table, match, trip and tile - and the same engine can be embedded through a C++ library interface with Node.js and Python bindings on top. Routing behaviour comes from Lua profiles shipped for car, bicycle and foot, and prepared data can follow one of two pipelines: Contraction Hierarchies or the recommended Multi-Level Dijkstra, which is the one that lets you re-apply live traffic speeds without re-partitioning. Running it yourself means downloading an .osm.pbf extract, processing it with the published container images and then starting osrm-routed on port 5000; a separate frontend image can be started alongside for a map UI. Datasets can be loaded into shared memory with osrm-datastore so several routed processes serve them with zero-copy access. Responses are JSON by default with a faster binary flatbuffers option, and queries are answered over plain HTTP rather than through an app login. Pre-processing is the slow part - the docs note a 550 MB Mexico extract took roughly 30 minutes. The project is released under the 2-clause BSD licence, maintained as a community effort and funded via GitHub Sponsors and PayPal.

Open Source Routing Machine (OSRM) alternatives

Should you self-host Open Source Routing Machine (OSRM)?

Open Source Routing Machine (OSRM) scores 71/100 on selfhost.directory (how scoring works) and ranks #1 of 7 in Navigation. It has 8 197 GitHub stars, +73 in the last 30 days.

It shipped 17 stable releases in the past year. The latest, v26.11.0, came out on 1 November 2026. New versions land roughly every 6 days.

Setup is moderate: expect some configuration beyond a single command. An official Docker image is available. It is BSD-2-Clause-licensed and written mostly in C++.

Its closest alternative on selfhost.directory is Valhalla (71/100, 6 427 stars). Open Source Routing Machine (OSRM) scores higher overall. See Open Source Routing Machine (OSRM) vs Valhalla side by side.

Features

  • Address snapping
  • Binary response format
  • Customizable routing profiles
  • Distance/duration matrix
  • Live traffic updates
  • Map Matching
  • Node.js Bindings
  • Python Bindings
  • REST API
  • Route finding
  • Shared-memory dataset serving
  • Trip planning (TSP)
  • Two routing algorithm pipelinesMLD is the recommended default
  • Vector tile generation

Open Source Routing Machine (OSRM) README

Open Source Routing Machine

osrm-backend CI Discord

High performance routing engine written in C++ designed to run on OpenStreetMap data.

The following services are available via HTTP API, C++ library interface and NodeJs wrapper:

How to install Open Source Routing Machine (OSRM)

Install Open Source Routing Machine (OSRM) with Docker

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

docker run -t -v "${PWD}:/data" ghcr.io/project-osrm/osrm-backend osrm-extract -p /opt/car.lua /data/berlin-latest.osm.pbf || echo "osrm-extract failed"
docker run -t -v "${PWD}:/data" ghcr.io/project-osrm/osrm-backend osrm-partition /data/berlin-latest.osrm || echo "osrm-partition failed"
docker run -t -v "${PWD}:/data" ghcr.io/project-osrm/osrm-backend osrm-customize /data/berlin-latest.osrm || echo "osrm-customize failed"
docker run -t -i -p 5000:5000 -v "${PWD}:/data" ghcr.io/project-osrm/osrm-backend osrm-routed --algorithm mld /data/berlin-latest.osrm

Optionally start a user-friendly frontend on port 9966:

docker run -p 9966:9966 osrm/osrm-frontend

Images are based on Debian Linux; for the CH pipeline replace osrm-partition and osrm-customize with osrm-contract and pass --algorithm ch.

How to configure Open Source Routing Machine (OSRM)

  • --helpShow the help message and exit.
  • --versionShow the version string and exit.
  • --verbosityLog verbosity: `NONE`, `ERROR`, `WARNING`, `INFO` (default), `DEBUG`.
  • --list-inputsPrint all required and optional input file extensions the tool expects, then exit. Useful for deployment scripts.
  • --threadsNumber of threads to use (default: number of logical CPUs).

Open Source Routing Machine (OSRM) releases & version history

@ Every self-hosted release, weekly

One Monday email with the week's stable releases across the directory.

More in Navigation

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…