How to Install Nominatim on macOS
Nominatim is a tool for searching and reverse geocoding the OpenStreetMap data. This guide will take you through the steps required to install Nominatim on macOS.
Prerequisites
Before installing Nominatim, ensure that you meet the following requirements:
- A macOS machine with at least 8GB of RAM.
- A stable internet connection.
- Docker installed on your machine.
Installation Steps
Open a Terminal window on your macOS machine.
Clone the Nominatim repository using the command below:
git clone https://github.com/openstreetmap/Nominatim.gitChange the directory to the cloned repository:
cd NominatimCreate a .env file by copying the contents of the .env.sample file using the command below:
cp .env.sample .envOpen the .env file and set the following environment variables:
PBF_URL=http://download.geofabrik.de/your-country-latest.osm.pbf POSTGRES_PASSWORD=<your_password>Replace
your-country-latest.osm.pbfwith the name of the OpenStreetMap PBF file for your desired location. You can find the latest files at https://download.geofabrik.de. Also, replace<your_password>with your desired password for your PostgreSQL database.Run the following command to download the OpenStreetMap PBF file:
./utils/setup.php --osm-file <your-country-latest.osm.pbf> --allReplace
<your-country-latest.osm.pbf>with the name of your PBF file.Run the following command to start the Nominatim Docker container:
docker-compose up -dYou can now access Nominatim by visiting http://localhost:8080 on your web browser.
Congratulations, you have successfully installed Nominatim on your macOS machine.