Nominatim is a popular open-source geocoding software for searching and processing global location data. In this tutorial, we will guide you through the process of installing Nominatim on Arch Linux.
Before proceeding with the Nominatim installation, ensure that your Arch Linux system has met the following requirements:
Before installing Nominatim, ensure that all necessary dependencies are installed on your system. Run the following command as root or with sudo:
sudo pacman -S gcc make cmake g++ libboost-iostreams libboost-system libboost-filesystem libexpat libgeos libpqxx libtool libxml2 libzip lua openstreetmap-license osmium-tool postgresql-libs proj protobuf-c python python-lxml python-psycopg2 python-pyosmium zlib bzip2
This command installs all required dependencies that are necessary for building Nominatim.
You can download the latest version of Nominatim from the official website or you can run the following command to download the source code:
wget https://nominatim.org/release/Nominatim-3.7.2.tar.bz2
After the download is completed, extract the package using the following command:
tar xvf Nominatim-3.7.2.tar.bz2
cd Nominatim-3.7.2
Now it's time to build and install Nominatim on your system. Run the following commands to compile and install Nominatim:
mkdir build
cd build
cmake ..
make
make install
Nominatim stores all location data in a PostgreSQL database. Therefore, setting up a PostgreSQL database is essential for running Nominatim.
First, install PostgreSQL on your system and create a new database by following these commands:
sudo pacman -S postgresql
sudo systemctl enable postgresql
sudo systemctl start postgresql
sudo su postgres
psql
CREATE DATABASE nominatim;
\q
exit
After installing PostgreSQL, you need to configure Nominatim by updating the settings in the local.php
file located in the settings
directory.
Copy the example configuration file to the settings
directory and rename it to local.php
with the following command:
cp ./settings/local.php.sample ./settings/local.php
Edit the local.php
file and enter your PostgreSQL database credentials and other settings appropriate for your system. You can refer to the local.php.sample
file for additional configuration options.
Finally, you need to import OpenStreetMap data into the newly created PostgreSQL database. Download the latest OpenStreetMap data dump from the official website or use the following command to download it:
wget https://download.geofabrik.de/north-america/us-latest.osm.pbf
After downloading the data, run the following command to import it into the database:
sudo nominatim import /path/to/openstreetmap/data.osm.pbf
After completing all the previous steps, you can finally start Nominatim by running the following command:
sudo nominatim Nominatim
Congratulations! You have successfully installed Nominatim on your Arch Linux system.
In this tutorial, we have shown you how to install Nominatim on Arch Linux. Now you can use Nominatim to search for global location data or create custom maps according to your needs.
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!