Skip to content

VROOM & OSRM Setup Guide

Getting Started

1. Get VROOM Docker Image

Get the latest vroom docker-image repo from GitHub:

2. Download OSRM Map Data

Download the latest OSRM Map data from:

Reference Guide:

Extract Map Data from OSM.pbf File with OSRM Backend Docker Server

Step 1: Download OpenStreetMap Data

Download OpenStreetMap extracts from Geofabrik:

bash
wget http://download.geofabrik.de/australia-oceania/australia-latest.osm.pbf

Step 2: Pre-process the Extract

Pre-process the extract with the car profile and start a routing engine HTTP server on port 5000:

bash
docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-extract -p /opt/car.lua /data/australia-latest.osm.pbf

Note: The flag -v "${PWD}:/data" creates the directory /data inside the docker container and makes the current working directory "${PWD}" available there. The file /data/australia-latest.osm.pbf inside the container is referring to "${PWD}/australia-latest.osm.pbf" on the host.

Step 3: Partition and Customize

bash
docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-partition /data/australia-latest.osrm
bash
docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-customize /data/australia-latest.osrm

Step 4: Start the Routing Server

bash
docker run -t -i -p 5000:5000 -v "${PWD}:/data" osrm/osrm-backend osrm-routed --algorithm mld /data/australia-latest.osrm

Docker Compose Setup

Create Docker Compose File

Create a docker-compose.yml file to run both VROOM and OSRM together:

yaml
version: "2.4"
services:
  vroom:
    network_mode: host
    image: vroomvrp/vroom-docker:v1.12.2
    container_name: vroom
    volumes:
      - ./vroom-conf/:/conf
    environment:
      - VROOM_ROUTER=osrm # router to use, osrm, valhalla or ors
    depends_on:
      - osrm

  # EXAMPLE for OSRM, please consult the repo for details: https://hub.docker.com/r/osrm/osrm-backend/
  osrm:
    image: osrm/osrm-backend
    container_name: osrm
    restart: always
    ports:
      - 5000:5000
    volumes:
      - ./osrm:/data
    command: "osrm-routed --max-matching-size 10000 --max-table-size 10000 --max-viaroute-size 10000 --algorithm mld /data/australia-latest.osrm"

Run the Services

Start both services with:

bash
docker-compose up

Directory Structure

Make sure you have the following directory structure:

project-folder/
├── docker-compose.yml
├── vroom-conf/
├── osrm/
│   └── australia-latest.osm.pbf
│   └── australia-latest.osrm (generated files)
└── other generated OSRM files

Important Notes

  • Ensure you have sufficient disk space for map data processing
  • The OSRM backend will generate several files during processing
  • Port 5000 will be used for the OSRM routing service
  • VROOM depends on OSRM being available before starting