This guide provides step-by-step instructions for setting up the Open Source Routing Machine (OSRM) backend on an * ARM64* architecture using Podman. This specific setup processes South Korean map data utilizing the MLD ( Multi-Level Dijkstra) algorithm.
Ensure your system has the following tools installed and accessible:
- Git: To clone the OSRM repository.
- Podman: For rootless container management and image building.
- Wget: To download the raw OpenStreetMap (OSM) data files.
Because pre-built ARM64 images are not always available or up-to-date on standard registries, we will build a custom image directly from the official source. Podman natively handles multi-architecture builds.
# Navigate into the cloned repository
cd osrm-backend
# Build the image natively for ARM64 architecture
podman build \
--platform linux/arm64 \
-f docker/Dockerfile-debian \
--build-arg DOCKER_TAG=local-arm64 \
--build-arg BUILD_CONCURRENCY=8 \
-t osrm-backend:arm64 .OSRM requires a specific preprocessing workflow to convert raw OSM data into an optimized, highly efficient routing format.
Download the latest OpenStreetMap (OSM) data for South Korea from the Geofabrik repository. Create or navigate to your
target storage directory and run:
# Download the latest South Korea map data
wget https://download.geofabrik.de/asia/south-korea-latest.osm.pbfWe will use the MLD (Multi-Level Dijkstra) algorithm, which is highly flexible and allows for fast dynamic updates.
| Phase | Command | Description |
|---|---|---|
| Extract | osrm-extract |
Converts .osm.pbf to .osrm format using a routing profile (e.g., car). |
| Partition | osrm-partition |
Partitions the graph into cells recursively for the MLD algorithm. |
| Customize | osrm-customize |
Calculates the routing weights for the partitioned cells. |
Run the following commands sequentially to process the data.
Note: The
-t 8flag specifies the number of threads. Adjust this value based on your system's CPU core count to optimize processing speed.
# 1. Extract data using the Car profile
podman run --rm -t -v $(pwd):/data osrm-backend:arm64 \
osrm-extract -p /opt/car.lua /data/south-korea-latest.osm.pbf -t 8
# 2. Partition the data
podman run --rm -t -v $(pwd):/data osrm-backend:arm64 \
osrm-partition /data/south-korea-latest.osrm -t 8
# 3. Customize the data
podman run --rm -t -v $(pwd):/data osrm-backend:arm64 \
osrm-customize /data/south-korea-latest.osrm -t 8Deploy the OSRM routing engine as a detached, background container. We map the container's default port (5000) to the
host's port (4000).
podman run -d \
--name osrm-backend \
-p 4000:5000 \
-v $(pwd):/data \
osrm-backend:arm64 \
osrm-routed --algorithm mld /data/south-korea-latest.osrmIf you require a web-based map interface for testing, you can spin up the official OSRM frontend container.
# Access the web UI at http://localhost:9966 once running
podman run -d \
--name osrm-frontend \
-p 9966:9966 \
osrm/osrm-frontendYou can verify that your backend server is running and routing correctly by sending a sample request via curl.
Note: The coordinates used below (
Longitude,Latitude) represent a sample route in South Korea, driving roughly from Seoul to Busan.
# Query the backend on host port 4000
curl "http://127.0.0.1:4000/route/v1/driving/127.0276,37.4979;129.0756,35.1796?steps=true"Ensure you have sufficient disk space before starting the data processing phase. The extracted and partitioned
.osrmfiles will be significantly larger than the initial compressed.osm.pbffile.