Skip to main content

Run openrouteservice on Your Own Computer

A beginner’s guide to unlimited routing, isochrones and travel-time matrices on Windows, macOS and Linux, used from R and Python

Step-by-step guide to running your own openrouteservice routing server with Docker on Windows, macOS or Linux, for any region, and calling it from R and Python with no API key and no daily limits.
R
Python
GIS
Transportation
Open Source
Developer Tools
Author

Pukar Bhandari

Published

November 30, 2026

Modified

November 30, 2026

openrouteservice (ORS) is an open-source routing engine built on OpenStreetMap data. It gives you driving, cycling and walking routes, isochrones (“everywhere I can reach in 15 minutes”) and travel-time matrices (“how long from each of these 500 homes to each of these 20 clinics”). The public API is free to sign up for, but every key has daily and per-minute quotas (see the plans). That is plenty for trying things out. It is not enough for an accessibility analysis over a whole city, and you hit the limit just as the analysis gets interesting.

What many people do not know is that the same engine runs on an ordinary laptop. The ORS team publishes it as a ready-made Docker image. You point it at a map file for your region, wait while it builds its routing graphs, and then you have the same API on http://localhost:8080 with no key and no quota. Your requests never leave your computer.

This guide assumes you have never used Docker. It works for any region in the world. The examples use Nepal, with test routes inside Kathmandu, and a later section shows how to swap in your own area. Where commands differ between operating systems, pick your system in the tabs; the choice carries through the whole page.

1 What you need

  • A 64-bit computer running Windows 10 (22H2) or 11, macOS 13 or later (Intel or Apple Silicon), or a recent Linux distribution.

  • Memory (RAM). ORS holds the road network in memory, so memory decides which regions you can build. A rough guide for the three profiles used here (car, bike, walk):

    Region (example) Map file Memory for ORS Computer RAM
    A city or small country (Monaco, Luxembourg) under 50 MB 1 GB 8 GB
    A country or US state (Nepal, Utah) 150 to 500 MB 3 to 4 GB 8 to 16 GB
    A large country (Germany, France) 4 to 5 GB 24 GB or more 32 GB or more
  • Disk space. Roughly 6 to 10 times the map file size, for the map file, the built graphs and the elevation data ORS downloads (Nepal: 0.4 GB of map became about 2.4 GB in total), plus about 750 MB for the ORS image.

  • An internet connection for the first setup. After the build, ORS works offline.

  • Administrator rights on your computer, to install Docker.

NoteWords you will see
  • Docker runs programs in containers: small, self-contained Linux environments with everything the program needs already installed. You do not install Java or ORS itself; you install Docker and it fetches ORS for you.
  • An image is the download (openrouteservice/openrouteservice:v10.1.1); a container is a running copy of it.
  • Docker Compose starts a container from a short settings file, docker-compose.yml, so you do not have to type long commands.
  • A .osm.pbf file is a compressed extract of OpenStreetMap for one area.
  • Graphs are the routing network ORS builds from that file. Building them is the slow part, and it only happens once per region.
  • A profile is a travel mode: driving-car, cycling-regular, foot-walking and so on.
  • An API is a set of web addresses that programs send requests to and get data back from. localhost means “this computer”, so http://localhost:8080 is a server running on your own machine, not on the internet.
  • GeoJSON is a common text format for map data (points, lines, areas). ORS answers in it, and R, Python and QGIS all read it.
TipHow to run the commands in this guide
  • Commands go into a terminal: PowerShell on Windows (Start menu → type PowerShell), Terminal on macOS (Applications → Utilities) or your Linux terminal.
  • Copy a command with the copy button at the top right of each grey box, paste it into the terminal, and press Enter. Pasting is right-click or Ctrl+V in PowerShell, Cmd+V on macOS and Ctrl+Shift+V in most Linux terminals.
  • Run one box at a time and wait for the prompt to come back before the next one.
  • Lines starting with # are comments for you to read; the terminal ignores them.
  • If something goes wrong, the troubleshooting section lists the common errors and what they mean.

2 Step 1: Install Docker

Docker on Windows runs on WSL 2 (Windows Subsystem for Linux). Both install from the command line with winget, which comes with Windows 10 and 11.

  1. Open the Start menu, type PowerShell, right-click Windows PowerShell and choose Run as administrator. Click Yes when Windows asks.

  2. Install WSL and Docker Desktop:

    wsl --install --no-distribution
    winget install --exact --id Docker.DockerDesktop --accept-package-agreements --accept-source-agreements
  3. Restart your computer.

  4. Open Docker Desktop from the Start menu and accept the agreement. If it asks about settings, choose the recommended ones. You can skip signing in. Wait until the bottom-left corner says Engine running.

  5. Open a normal (not administrator) PowerShell window and check:

    docker --version
    docker compose version

    Both should print a version number.

Every command in this guide is typed straight into PowerShell; there are no script files to run, so PowerShell’s execution policy does not get in the way.

Tip

If winget is not found, install App Installer from the Microsoft Store. If you would rather click through an installer, download Docker Desktop from docker.com instead of step 2’s second line.

The quickest route is Homebrew. Open Terminal (Applications → Utilities) and run:

# Skip this line if you already have Homebrew (check with: brew --version)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

brew install --cask docker-desktop

Without Homebrew, download Docker Desktop for your chip (Apple Silicon or Intel) from docker.com and drag it to Applications.

Then open Docker from Applications, accept the agreement (signing in is optional) and wait for Engine running. Check in Terminal:

docker --version
docker compose version

The ORS image is built for both Intel and Apple Silicon, so it runs natively on M-series Macs.

On Linux you install Docker Engine directly; there is no Desktop app to open. Docker’s official script works on Ubuntu, Debian, Fedora, RHEL, CentOS and their relatives:

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

# Let your user run docker without sudo
sudo usermod -aG docker $USER

Log out and back in (or reboot) so the group change takes effect, then check:

docker --version
docker compose version
docker run --rm hello-world

On Arch, use sudo pacman -S docker docker-compose and sudo systemctl enable --now docker instead of the script.

3 Step 2: Make a project folder

Everything for your routing server lives in one folder. At the end of the guide it will look like this:

ors-local/
├── docker-compose.yml         you write this (step 4)
└── ors-docker/
    ├── config/
    │   └── ors-config.yml     you write this (step 4)
    ├── files/
    │   └── nepal-latest.osm.pbf   the map (step 3)
    ├── graphs/                built by ORS
    ├── elevation_cache/       downloaded by ORS
    └── logs/                  written by ORS

In PowerShell:

cd $HOME\Documents
mkdir ors-local\ors-docker\files, ors-local\ors-docker\config
cd ors-local
cd ~/Documents
mkdir -p ors-local/ors-docker/{files,config,graphs,elevation_cache,logs}
cd ors-local
cd ~
mkdir -p ors-local/ors-docker/{files,config,graphs,elevation_cache,logs}
cd ors-local

Creating all five folders yourself means they belong to you rather than to Docker, which saves permission trouble later.

Check: run ls. You should see ors-docker listed. pwd shows which folder you are in; it should end in ors-local.

Stay in this ors-local folder for the rest of the guide. If you close the window, open a new one and go back with cd ~/Documents/ors-local (macOS and Windows) or cd ~/ors-local (Linux) before running more commands.

4 Step 3: Download the map for your region

Geofabrik publishes OpenStreetMap extracts for every continent, country and many states and provinces, refreshed daily. To find a link, click through to your area (Asia → Nepal) and copy the link to the .osm.pbf file. For Nepal it is:

https://download.geofabrik.de/asia/nepal-latest.osm.pbf

Download it straight into ors-docker/files. curl comes with Windows 10 and 11, macOS and nearly every Linux, so there is nothing extra to install.

curl.exe -L -C - -o ors-docker\files\nepal-latest.osm.pbf https://download.geofabrik.de/asia/nepal-latest.osm.pbf

Type curl.exe, not curl: in Windows PowerShell, plain curl is a nickname for a different command (Invoke-WebRequest) that takes different options.

curl -L -C - -o ors-docker/files/nepal-latest.osm.pbf https://download.geofabrik.de/asia/nepal-latest.osm.pbf
curl -L -C - -o ors-docker/files/nepal-latest.osm.pbf https://download.geofabrik.de/asia/nepal-latest.osm.pbf

While it runs, curl shows a progress table: the first column is the percentage done, and the download is finished when the prompt comes back. Nepal is about 400 MB. If the download stops partway, run the same command again and it carries on from where it stopped.

(For the curious: -L follows redirects, -C - resumes an interrupted download, and -o sets where to save the file.)

Check: ls ors-docker/files (or ls ors-docker\files on Windows) lists nepal-latest.osm.pbf, a little over 400 MB.

Geofabrik publishes a checksum next to every file (the same link with .md5 added). Compare it with your copy; the two strings should match.

curl.exe -s https://download.geofabrik.de/asia/nepal-latest.osm.pbf.md5
(Get-FileHash ors-docker\files\nepal-latest.osm.pbf -Algorithm MD5).Hash.ToLower()
curl -s https://download.geofabrik.de/asia/nepal-latest.osm.pbf.md5
md5 -q ors-docker/files/nepal-latest.osm.pbf
curl -s https://download.geofabrik.de/asia/nepal-latest.osm.pbf.md5
md5sum ors-docker/files/nepal-latest.osm.pbf

A whole-country file is the simplest choice and usually fine. If your country is large and you only need one city, you can cut the file down with osmium (osmium extract --bbox 85.18,27.55,85.55,27.82 nepal-latest.osm.pbf -o kathmandu.osm.pbf keeps the Kathmandu Valley). That is one more tool to install, so skip it unless memory is tight. Another option is BBBike’s extract service, which cuts an area you draw on a map.

5 Step 4: Write the two settings files

ORS needs two small text files. Their content is the same on every system; only the way you open a text editor differs. Open each file as shown in your tab, then copy the content from the matching grey box further down (copy button, top right) and paste it in. The numbers next to the boxes explain each line; they are not part of the file.

notepad docker-compose.yml

Notepad asks whether to create the file; click Yes, paste the content below, and save. For the second file:

notepad ors-docker\config\ors-config.yml

Use Notepad (or VS Code), not Word, which adds formatting that breaks the files.

nano docker-compose.yml

Paste the content below, then press Ctrl+O, Enter to save and Ctrl+X to quit. For the second file:

nano ors-docker/config/ors-config.yml

Avoid TextEdit, which saves rich text by default. VS Code works too (code docker-compose.yml).

nano docker-compose.yml

Paste the content below, then press Ctrl+O, Enter to save and Ctrl+X to quit. For the second file:

nano ors-docker/config/ors-config.yml

docker-compose.yml

This tells Docker which ORS version to run, which port to use, where the folder is, and how much memory to give it.

docker-compose.yml
services:
  ors-app:
    image: openrouteservice/openrouteservice:v10.1.1
    container_name: ors-local
    ports:
      - "8080:8082"
    volumes:
      - ./ors-docker:/home/ors
    environment:
      REBUILD_GRAPHS: "false"
      XMS: 1g
      XMX: 4g
1
The ORS release to download. Pinning a version means your setup does not change under you; check Docker Hub for newer releases.
2
ORS listens on port 8082 inside the container; this makes it reachable on port 8080 of your computer. If something else already uses 8080, change only the first number, for example "8090:8082".
3
Your ors-docker folder appears inside the container as /home/ors. That is how ORS finds the map and where it saves graphs, so they survive restarts.
4
Leave this false. ORS builds graphs automatically when there are none (see switching regions).
5
Memory for ORS: XMS at start, XMX at most. 4g suits Nepal; see how much memory for other regions.

ors-docker/config/ors-config.yml

This tells ORS which map file to read, which travel modes to build, and how big a request it will accept.

ors-docker/config/ors-config.yml
ors:
  engine:
    profile_default:
      build:
        source_file: /home/ors/files/nepal-latest.osm.pbf
      service:
        maximum_distance: 1000000
    profiles:
      driving-car:
        enabled: true
      cycling-regular:
        enabled: true
      foot-walking:
        enabled: true
  endpoints:
    isochrones:
      maximum_locations: 100
      maximum_intervals: 10
    matrix:
      maximum_routes: 100000
1
The map file, as ORS sees it inside the container: /home/ors/files/ is your ors-docker/files folder.
2
Longest route allowed, in metres. The built-in default is 100 km; this raises it to 1,000 km so long routes (Kathmandu to Pokhara is about 200 km) work.
3
The travel modes to build. Each extra profile costs build time and memory. Others you can add: driving-hgv (trucks), cycling-road, cycling-mountain, cycling-electric, foot-hiking and wheelchair.
4
Your server, your limits. Out of the box a local ORS accepts only one isochrone band per request and a few thousand matrix cells; these raise them. The full list of settings is in the ORS configuration docs.
Warning

YAML files are sensitive to indentation: use spaces, not tabs, and keep the nesting exactly as shown. If ORS stops right after starting, a misplaced space in one of these files is the most likely cause.

6 Step 5: Start ORS and wait for the build

Make sure Docker Desktop is running (Windows and macOS), and that your terminal is in the ors-local folder (ls shows docker-compose.yml). Then, on any system:

docker compose up -d

You should see a few lines ending in Container ors-local Started.

The first time, Docker downloads the ORS image (about 750 MB once unpacked). Then ORS starts and builds the graphs. -d runs it in the background, so you get your prompt back immediately. To watch what it is doing:

docker compose logs -f

Press Ctrl+C to stop watching; ORS keeps running. During the build you will see lines about reading the map, downloading elevation data and preparing each profile. You will also see a lot of warnings about “protobuf gencode”; they are harmless and can be ignored.

How long the build takes depends on the region and your computer: under a minute for a small region, about 7 minutes for Nepal on my work laptop, and an hour or more for a large country. The first build also downloads elevation tiles, which ORS uses for cycling and walking times on hills. For Nepal, the finished graphs took 860 MB and the elevation data 1.1 GB, and ORS used about 4.3 GB of memory while running.

ORS is ready when the health check says so. Open this in your browser:

http://localhost:8080/ors/v2/health

While building, it answers {"status":"not ready"} (or the page does not load yet). When it answers

{"status":"ready"}

your routing server is up. Later starts reuse the saved graphs and are ready in seconds (11 for Nepal).

7 Step 6: Ask for your first route

Paste this into your browser. It asks for a driving route from Thamel to Patan Durbar Square:

http://localhost:8080/ors/v2/directions/driving-car?start=85.3103,27.7154&end=85.3250,27.6727

You get back GeoJSON: the route’s line, plus a summary with the distance in metres and the duration in seconds: "summary":{"distance":7177.0,"duration":646.6}, or 7.2 km in about 11 minutes. Change driving-car to cycling-regular or foot-walking for the other modes.

A longer one, Kathmandu to Pokhara, works because of the maximum_distance setting in step 4 (about 196 km and just under 3 hours):

http://localhost:8080/ors/v2/directions/driving-car?start=85.3103,27.7154&end=83.9856,28.2096

Without that setting, ORS refuses it with “The approximated route distance must not be greater than 100000.0 meters.”

ImportantLongitude first

ORS writes coordinates as longitude, latitude (x, y), the opposite of the “latitude, longitude” order Google Maps shows. Kathmandu is 85.31,27.71, not 27.71,85.31. Swapping them is the most common reason for a “could not find point” error.

The server also has the full API documentation built in, where you can try every endpoint from the browser: http://localhost:8080/ors/swagger-ui/index.html.

8 Use it from R and Python

The official R and Python packages talk to your local server just as they talk to the public API. You change one setting, the address, and leave out the API key. The maps below are drawn with mapview in R and folium (through GeoPandas’ explore()) in Python. Both make interactive Leaflet maps you can pan, zoom and click.

Every result in this section came from a local ORS server running the Nepal map (downloaded 30 November 2026), set up exactly as above. If you re-run the code later, the numbers may differ a little because OpenStreetMap keeps changing.

Not an R or Python user? You can skip this section: the browser links in step 6 already use the same API.

Install the packages

Do this once. In R, run this in the R console (RStudio or Positron). For Python, run it in a terminal; use your usual environment (a virtual environment, conda, or uv add instead of pip install).

install.packages(c("openrouteservice", "sf", "mapview", "dplyr"))
pip install "openrouteservice<2.4" geopandas folium matplotlib

Version 2.4.0 (released November 2026) fails on import openrouteservice with AttributeError: module 'importlib' has no attribute 'metadata', and it changes how the server address is given. Until that is fixed, <2.4 gets you 2.3.3, which works. If you do use 2.4.0, run import importlib.metadata before importing the package and connect with Client(base_url="http://localhost:8080"), adding ors_path="/ors" to every call.

Connect to your server

Tell the package where your server is. No API key is needed.

options(openrouteservice.url = "http://localhost:8080/ors")

Put this line at the top of every script that uses ORS (or in your .Rprofile, so it runs every time R starts).

The R code below writes every function as package::function(), for example openrouteservice::ors_directions(). That way you can always see which package a function comes from, and you do not need any library() calls.

import openrouteservice as ors
import geopandas as gpd
import pandas as pd

client = ors.Client(base_url="http://localhost:8080/ors")

# Background map for the maps below (Esri light grey, no key needed)
esri_gray = "https://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}"
esri_attr = "Tiles &copy; Esri"

Fastest and shortest route

ORS can optimise a route for time (preference = "fastest", the default) or for distance ("shortest"). They are often different roads: the shortest route squeezes through small streets, while the fastest stays on bigger, quicker roads. This asks ORS for both between Thamel and Patan Durbar Square, then stacks the two answers into one table: one row per route, with its distance, its travel time and the line itself. Remember: longitude first.

thamel <- c(85.3103, 27.7154)  # longitude, latitude
patan  <- c(85.3250, 27.6727)

# The start and end points, as one sf table
stops <- sf::st_as_sf(
  data.frame(
    place = c("Thamel (start)", "Patan Durbar Square (end)"),
    lon   = c(thamel[1], patan[1]),
    lat   = c(thamel[2], patan[2])
  ),
  coords = c("lon", "lat"),
  crs    = 4326
)

# Ask ORS for each route
fastest <- openrouteservice::ors_directions(
  list(thamel, patan), profile = "driving-car", preference = "fastest", output = "sf"
)
shortest <- openrouteservice::ors_directions(
  list(thamel, patan), profile = "driving-car", preference = "shortest", output = "sf"
)

# Each answer has a summary: distance in metres and duration in seconds
fastest_summary  <- fastest$summary[[1]]
shortest_summary <- shortest$summary[[1]]

# Stack the two into one table, with the route name, distance (km) and time (minutes)
routes <- rbind(fastest, shortest) |>
  dplyr::mutate(
    route   = c("fastest", "shortest"),
    km      = round(c(fastest_summary$distance, shortest_summary$distance) / 1000, 1),
    minutes = round(c(fastest_summary$duration, shortest_summary$duration) / 60)
  ) |>
  dplyr::select(route, km, minutes)

sf::st_drop_geometry(routes)  # show the table without the long geometry column
     route  km minutes
1  fastest 7.2      11
2 shortest 6.3      18

Now map it: the routes coloured by the route column, plus the start and end points. Click a line to see its distance and time, or hover over a point to see its name.

mapview::mapview(routes, zcol = "route", color = c("#1f78b4", "#e66101"), lwd = 5,
                 layer.name = "Route", map.types = "Esri.WorldGrayCanvas") +
  mapview::mapview(stops, label = stops$place, col.regions = "black", cex = 6,
                   legend = FALSE, layer.name = "Start and end")
thamel = [85.3103, 27.7154]  # longitude, latitude
patan = [85.3250, 27.6727]

# The start and end points, as one GeoDataFrame
stops = gpd.GeoDataFrame(
    {"place": ["Thamel (start)", "Patan Durbar Square (end)"]},
    geometry=gpd.points_from_xy([thamel[0], patan[0]], [thamel[1], patan[1]]),
    crs="EPSG:4326",
)

# Ask ORS for each route
fastest = client.directions([thamel, patan], profile="driving-car", preference="fastest", format="geojson")
shortest = client.directions([thamel, patan], profile="driving-car", preference="shortest", format="geojson")

# Each answer has a summary: distance in metres and duration in seconds
fastest_summary = fastest["features"][0]["properties"]["summary"]
shortest_summary = shortest["features"][0]["properties"]["summary"]

# Stack the two into one table, with the route name, distance (km) and time (minutes)
routes = (
    pd.concat(
        [gpd.GeoDataFrame.from_features(fastest["features"], crs="EPSG:4326"),
         gpd.GeoDataFrame.from_features(shortest["features"], crs="EPSG:4326")],
        ignore_index=True,
    )
    .assign(
        route=["fastest", "shortest"],
        km=(pd.Series([fastest_summary["distance"], shortest_summary["distance"]]) / 1000).round(1),
        minutes=(pd.Series([fastest_summary["duration"], shortest_summary["duration"]]) / 60).round().astype(int),
    )
    [["route", "km", "minutes", "geometry"]]
)

routes.drop(columns="geometry")  # show the table without the long geometry column  # show the table without the long geometry column
      route   km  minutes
0   fastest  7.2       11
1  shortest  6.3       18

Now map it: the routes coloured by the route column, plus the start and end points. Hover over a line or point to see its details.

m = routes.explore(
    column="route", cmap=["#1f78b4", "#e66101"], style_kwds={"weight": 5},
    legend_kwds={"caption": "Route"}, tiles=esri_gray, attr=esri_attr, zoom_start=13,
)
m = stops.explore(m=m, tooltip="place", color="black", marker_kwds={"radius": 6})
m
Make this Notebook Trusted to load map: File -> Trust Notebook

When I ran this, the shortest route was 6.3 km but took 18 minutes, while the fastest was almost a kilometre longer (7.2 km) yet took only 11. For travel-time questions you almost always want the default, "fastest".

Isochrones: how far can you walk?

An isochrone is the area you can reach within a given time. This asks for everywhere reachable on foot from Thamel within 10, 20 and 30 minutes. range is in seconds, so 10 minutes is 600.

walk <- openrouteservice::ors_isochrones(
  list(thamel),
  profile = "foot-walking",
  range   = c(600, 1200, 1800),
  output  = "sf"
)

# Label each band, and put the biggest first so the smaller ones are drawn on top
walk$minutes <- factor(paste(walk$value / 60, "min"), levels = c("10 min", "20 min", "30 min"))
walk <- walk[order(-walk$value), c("minutes", "geometry")]

# Colours follow the row order (30, 20, 10 min): the closer, the darker
mapview::mapview(walk, zcol = "minutes", col.regions = c("#c6dbef", "#6baed6", "#08519c"),
                 alpha.regions = 0.5, layer.name = "Walking time", map.types = "Esri.WorldGrayCanvas") +
  mapview::mapview(stops[1, ], label = stops$place[1], col.regions = "black", cex = 6,
                   legend = FALSE, layer.name = "Start")
iso = client.isochrones([thamel], profile="foot-walking", range=[600, 1200, 1800])
walk = gpd.GeoDataFrame.from_features(iso["features"], crs="EPSG:4326")

# Label each band, and put the biggest first so the smaller ones are drawn on top
walk["minutes"] = (walk["value"] // 60).astype(int).astype(str) + " min"
walk = walk.sort_values("value", ascending=False)[["minutes", "geometry"]]

# Colours follow the sorted labels (10, 20, 30 min): the closer, the darker
m = walk.explore(column="minutes", cmap=["#08519c", "#6baed6", "#c6dbef"],
                 style_kwds={"fillOpacity": 0.5}, legend_kwds={"caption": "Walking time"},
                 tiles=esri_gray, attr=esri_attr, zoom_start=13)
m = stops.iloc[[0]].explore(m=m, tooltip="place", color="black", marker_kwds={"radius": 6})
m
Make this Notebook Trusted to load map: File -> Trust Notebook

A travel-time matrix

A matrix gives the travel time (and distance) between every pair of points in one request: here Thamel, Patan and a point on the way to Bhaktapur. Times come back in seconds, so divide by 60 for minutes. Read it as “row to column”: the first row is from Thamel to each place.

places <- list(thamel, patan, c(85.3600, 27.6710))
m <- openrouteservice::ors_matrix(places, profile = "driving-car", metrics = c("duration", "distance"))
round(m$durations / 60)  # minutes
     [,1] [,2] [,3]
[1,]    0   11   15
[2,]   12    0    8
[3,]   14    9    0
places = [thamel, patan, [85.3600, 27.6710]]
m = client.distance_matrix(places, profile="driving-car", metrics=["duration", "distance"])
(pd.DataFrame(m["durations"]) / 60).round().astype(int)  # minutes
    0   1   2
0   0  11  15
1  12   0   8
2  14   9   0

This is where a local server pays off. A 500 × 20 matrix, or isochrones around every school in a district, is one loop away and costs nothing.

Any other tool that can make a web request works the same way, because the API is the same as the public one: send requests to http://localhost:8080/ors/v2/... instead of https://api.openrouteservice.org/v2/... and drop the key. That includes QGIS plugins and other packages that let you set the server address.

NoteWhat a local server does not include

The local ORS covers directions, isochrones, matrices, snapping and the export endpoint. Geocoding (turning an address into coordinates) and points of interest are separate services on the public API and are not part of this image. Geocode your addresses some other way, or keep using the public API for those calls only.

9 Everyday use

All of these run from the ors-local folder.

To Run
Stop ORS (graphs are kept) docker compose down
Start it again docker compose up -d
Check whether it is running docker compose ps
See the last log lines docker compose logs --tail 50

ORS does not start by itself after you restart the computer: open Docker Desktop (Windows and macOS) and run docker compose up -d. To have it start automatically, add restart: unless-stopped under container_name: in docker-compose.yml.

10 Use a different region

Switching regions means a new map file, one changed line, and a fresh build. Say you want Utah instead of Nepal:

  1. Find the link on Geofabrik (North America → United States of America → Utah).
  2. Download it into ors-docker/files, as in step 3, with the new link and file name.
  3. Change source_file in ors-docker/config/ors-config.yml to the new file name, for example /home/ors/files/utah-latest.osm.pbf.
  4. Adjust XMX in docker-compose.yml if the new file is much larger (see below).
  5. Delete the old graphs and restart. ORS only builds graphs when the graphs folder is empty; otherwise it keeps serving the old region.
docker compose down
Remove-Item -Recurse -Force ors-docker\graphs
docker compose up -d
docker compose down
rm -rf ors-docker/graphs
docker compose up -d
docker compose down
sudo rm -rf ors-docker/graphs   # the container writes these as root, so sudo is needed
docker compose up -d

The same steps update your map data, since OpenStreetMap changes every day. Delete the old .osm.pbf first (otherwise curl -C - sees a complete file and downloads nothing), download it again, delete the graphs and restart.

You can keep several map files in ors-docker/files; only the one named in source_file is used.

11 How much memory to give ORS

ORS’s own rule of thumb for XMX is

\text{XMX} \approx \text{map file size (GB)} \times \text{number of profiles} \times 2

For Nepal, 0.4 GB × 3 profiles × 2 ≈ 2.4 GB, rounded up to 4g for headroom. For Germany with the same three profiles it is 4.9 × 3 × 2 ≈ 30 GB, which is why big countries need big machines (or fewer profiles).

Docker itself also has a memory ceiling, and XMX has to fit under it:

Docker Desktop on WSL 2 can use up to half of your computer’s RAM by default. To allow more, create a file named .wslconfig in your user folder:

notepad $HOME\.wslconfig

with, for example on a 32 GB machine:

[wsl2]
memory=24GB

Then run wsl --shutdown and restart Docker Desktop.

Docker Desktop → Settings → Resources → Memory. Move the slider, then Apply & restart.

There is no limit beyond your computer’s RAM. Leave a couple of gigabytes free for the system.

Check how much memory Docker can use with docker info; look for Total Memory.

12 Troubleshooting

“docker: command not found” or “docker is not recognized”. Docker is not installed, or the window was opened before it was. Close the window, open a new one, and try again. On Windows, restarting the computer after the install is required.

“Cannot connect to the Docker daemon” / “error during connect”. Docker is installed but not running. On Windows and macOS, open Docker Desktop and wait for Engine running. On Linux, run sudo systemctl start docker.

“permission denied while trying to connect to the Docker daemon socket” (Linux). Your user is not in the docker group yet. Run sudo usermod -aG docker $USER, then log out and back in.

“WSL 2 installation is incomplete” or “Virtualization support not detected” (Windows). Hardware virtualization is switched off in your computer’s firmware. Restart into the BIOS/UEFI settings (usually by pressing F2, F10, F12 or Del while starting) and enable Intel VT-x, AMD-V or SVM Mode. Task Manager → Performance → CPU shows Virtualization: Enabled when it is on.

“no configuration file provided: not found”. The terminal is not in the ors-local folder, so Docker cannot find docker-compose.yml. Go there with cd (see step 2) and try again. On Windows, also check that Notepad did not save the file as docker-compose.yml.txt: ls shows the full name.

“port is already allocated” or “address already in use”. Another program uses port 8080. Change "8080:8082" to "8090:8082" in docker-compose.yml, run docker compose up -d again, and use localhost:8090 everywhere instead.

“The container name”/ors-local” is already in use”. An old container with the same name is left over, for example from an earlier attempt in another folder. Remove it with docker rm -f ors-local (your graphs and map file are in your folder, not in the container, so nothing is lost), or change container_name: in docker-compose.yml to another name.

The container stops during the build, or the log shows OutOfMemoryError. ORS ran out of memory. Raise XMX (and Docker’s own limit, above), or enable fewer profiles. Then delete the graphs folder and start again, because a half-built graph is not usable.

The health page never says “ready”. Look at the log with docker compose logs --tail 50. A message mentioning source_file or “No such file” means the file name in ors-config.yml does not match the file in ors-docker/files (names are case-sensitive). A message about YAML means an indentation mistake in one of the settings files.

Routes come back for the wrong place, or “could not find point”. Either the coordinates are latitude-first (ORS wants longitude first), the point is outside your map region, or the graphs are still from an earlier region: delete the graphs folder and restart.

“Request parameters exceed the server configuration limits”. The request is bigger than the limits in ors-config.yml, such as a route longer than maximum_distance or more isochrone bands than maximum_intervals. Raise the limit, then docker compose restart.

13 Wrapping up

Five things are all it takes: Docker, a folder, a map file, two short settings files and docker compose up -d. After that, the routing engine behind openrouteservice.org runs on your own computer, for whichever part of the world you need, with no key and no daily limit, and your R or Python code only needs a different address.

Citation

BibTeX citation:
@online{bhandari2026,
  author = {Bhandari, Pukar},
  title = {Run Openrouteservice on {Your} {Own} {Computer}},
  date = {2026-11-30},
  url = {https://ar-puuk.github.io/posts/local-openrouteservice/},
  langid = {en-US}
}
For attribution, please cite this work as:
Bhandari, Pukar. 2026. “Run Openrouteservice on Your Own Computer.” November 30. https://ar-puuk.github.io/posts/local-openrouteservice/.