How to Install Open Source Routing Machine (OSRM) on macOS

Open Source Routing Machine (OSRM) is a routing engine for OpenStreetMap data. In this tutorial, we'll show you how to install OSRM on macOS.

Prerequisites

Before we begin, you'll need to make sure you have the following prerequisites installed:

You can install both of these by running the following command in your terminal:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install cmake

Installing OSRM

Follow the steps below to install OSRM:

  1. Open your terminal and run the following command to clone the OSRM repository to your local machine:
git clone https://github.com/Project-OSRM/osrm-backend.git
  1. Change your working directory to the cloned repository by running:
cd osrm-backend
  1. Create a new directory named build and change your working directory to it:
mkdir build
cd build
  1. Run the cmake command to generate the Makefile:
cmake ..
  1. Run the make command to compile and build the binary files:
make
  1. Finally, run the following command to start the OSRM server:
./osrm-routed ../data.osm.pbf

Verifying OSRM installation

To verify that OSRM has been installed correctly, open your browser and navigate to http://localhost:5000/status. You should see a JSON output containing information about the running OSRM server.

Congratulations! You've successfully installed OSRM on your macOS machine. You can now use OSRM for routing and navigation.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!