is assumed that you have already successfully installed the Nominatim
software itself, if not return to the [installation page](Installation.md).
-## Configuration setup in settings/local.php
+## Configuration setup in `.env`
-The Nominatim server can be customized via the file `settings/local.php`
-in the build directory. Note that this is a PHP file, so it must always
-start like this:
-
- <?php
-
-without any leading spaces.
+The Nominatim server can be customized via a `.env` in the build directory.
+This is a file in [dotenv](https://symfony.com/doc/4.3/components/dotenv.html) format
+which looks the same as variable settings in a standard shell environment.
+You can also set the same configuration via environment variables. All
+settings have a `NOMINATIM_` prefix to avoid conflicts with other environment
+variables.
There are lots of configuration settings you can tweak. Have a look
-at `settings/default.php` for a full list. Most should have a sensible default.
+at `settings/env.default` for a full list. Most should have a sensible default.
#### Flatnode files
you should also enable flatnode storage of node locations. With this
setting enabled, node coordinates are stored in a simple file instead
of the database. This will save you import time and disk storage.
-Add to your `settings/local.php`:
+Add to your `.env`:
- @define('CONST_Osm2pgsql_Flatnode_File', '/path/to/flatnode.file');
+ NOMINATIM_FLATNODE_FILE="/path/to/flatnode.file"
Replace the second part with a suitable path on your system and make sure
the directory exists. There should be at least 75GB of free space.
!!! tip
If you forgot to download the wikipedia rankings, you can also add
importances after the import. Download the files, then run
- `./utils/setup.php --import-wikipedia-articles`
- and `./utils/update.php --recompute-importance`.
+ `./nominatim refresh --wiki-data --importance`.
### Great Britain, USA postcodes
In its default setup Nominatim is configured to import the full OSM data
set for the entire planet. Such a setup requires a powerful machine with
-at least 64GB of RAM and around 800GB of SSD hard disks. Depending on your
+at least 64GB of RAM and around 900GB of SSD hard disks. Depending on your
use case there are various ways to reduce the amount of data imported. This
section discusses these methods. They can also be combined.
About half of the data in Nominatim's database is not really used for serving
the API. It is only there to allow the data to be updated from the latest
changes from OSM. For many uses these dynamic updates are not really required.
-If you don't plan to apply updates, the dynamic part of the database can be
-safely dropped using the following command:
+If you don't plan to apply updates, you can run the import with the
+`--no-updates` parameter. This will drop the dynamic part of the database as
+soon as it is not required anymore.
+
+You can also drop the dynamic part later using the following command:
```
-./utils/setup.php --drop
+./nominatim freeze
```
Note that you still need to provide for sufficient disk space for the initial
Like the full style but also adds most of the OSM tags into the extratags
column.
-The style can be changed with the configuration `CONST_Import_Style`.
+The style can be changed with the configuration `NOMINATIM_IMPORT_STYLE`.
To give you an idea of the impact of using the different styles, the table
below gives rough estimates of the final database size after import of a
style | Import time | DB size | after drop
----------|--------------|------------|------------
admin | 4h | 215 GB | 20 GB
-street | 42h | 400 GB | 180 GB
-address | 59h | 500 GB | 260 GB
-full | 80h | 575 GB | 300 GB
-extratags | 80h | 585 GB | 310 GB
+street | 22h | 440 GB | 185 GB
+address | 36h | 545 GB | 260 GB
+full | 54h | 640 GB | 330 GB
+extratags | 54h | 650 GB | 340 GB
You can also customize the styles further.
A [description of the style format](../develop/Import.md#configuring-the-import)
from the **build directory** to start the import:
```sh
-./utils/setup.php --osm-file <data file> --all 2>&1 | tee setup.log
+./nominatim import --osm-file <data file> 2>&1 | tee setup.log
```
### Notes on full planet imports
Run this script to verify all required tables and indices got created successfully.
```sh
-./utils/check_import_finished.php
+./nominatim check-database
```
-### Setting up the website
-
-Run the following command to set up the configuration file for the API frontend
-`settings/settings-frontend.php`. These settings are used in website/*.php files.
-
-```sh
-./utils/setup.php --setup-website
-```
-!!! Note
- This step is not necessary if you use `--all` option while setting up the DB.
+### Testing the installation
Now you can try out your installation by running:
of forward geocoding in particular under high load. To recompute word counts run:
```sh
-./utils/update.php --recompute-word-counts
+./nominatim refresh --word-counts
```
This will take a couple of hours for a full planet installation. You can
[special key phrases](https://wiki.openstreetmap.org/wiki/Nominatim/Special_Phrases)
you also need to enable these key phrases like this:
- ./utils/specialphrases.php --wiki-import > specialphrases.sql
+ ./nominatim special-phrases --from-wiki > specialphrases.sql
psql -d nominatim -f specialphrases.sql
Note that this command downloads the phrases from the wiki link above. You
1. Get preprocessed TIGER 2019 data and unpack it into the
data directory in your Nominatim sources:
- cd Nominatim/data
wget https://nominatim.org/data/tiger2019-nominatim-preprocessed.tar.gz
tar xf tiger2019-nominatim-preprocessed.tar.gz
2. Import the data into your Nominatim database:
- ./utils/setup.php --import-tiger-data
+ ./nominatim add-data --tiger-data tiger
- 3. Enable use of the Tiger data in your `settings/local.php` by adding:
+ 3. Enable use of the Tiger data in your `.env` by adding:
- @define('CONST_Use_US_Tiger_Data', true);
+ NOMINATIM_USE_US_TIGER_DATA=yes
4. Apply the new settings:
```sh
- ./utils/setup.php --create-functions --enable-diff-updates --create-partition-functions
+ ./nominatim refresh --functions
```