Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Nominatim Docker (Nominatim version 3.1)
1. Build
```
docker build -t nominatim .
```
2. Copy <your_country>.osm.pbf to a local directory (i.e. /home/me/nominatimdata)
3. Initialize Nominatim Database
```
docker run -t -v /home/me/nominatimdata:/data nominatim sh /app/init.sh /data/merged.osm.pbf postgresdata 4
```
Where 4 is the number of threads to use during import. In general the import of data in postgres is a very time consuming
process that may take hours or days. If you run this process on a multiprocessor system make sure that it makes the best use
of it. You can delete the /home/me/nominatimdata/merged.osm.pbf once the import is finished.
4. After the import is finished the /home/me/nominatimdata/postgresdata folder will contain the full postgress binaries of
a postgis/nominatim database. The easiest way to start the nominatim as a single node is the following:
```
docker run --restart=always -p 6432:5432 -p 7070:8080 -d -v /home/me/nominatimdata/postgresdata:/var/lib/postgresql/9.5/main nominatim sh /app/start.sh
```
5. Advanced configuration. If necessary you can split the osm installation into a database and restservice layer
In order to set the nominatib-db only node:
```
docker run --restart=always -p 6432:5432 -d -v /home/me/nominatimdata/postgresdata:/var/lib/postgresql/9.5/main nominatim sh /app/startpostgres.sh
```
After doing this create the /home/me/nominatimdata/conf folder and copy there the docker/local.php file. Then uncomment the following line:
```
@define('CONST_Database_DSN', 'pgsql://nominatim:password1234@192.168.1.128:6432/nominatim'); // <driver>://<username>:<password>@<host>:<port>/<database>
```
You can start the nominatib-rest only node with the following command:
```
docker run --restart=always -p 7070:8080 -d -v /home/me/nominatimdata/conf:/data nominatim sh /app/startapache.sh
```
6. Configure incremental update. By default CONST_Replication_Url configured for Monaco.
If you want a different update source, you will need to declare `CONST_Replication_Url` in local.php. Documentation [here] (https://github.com/openstreetmap/Nominatim/blob/master/docs/Import-and-Update.md#updates). For example, to use the daily country extracts diffs for Gemany from geofabrik add the following:
```
@define('CONST_Replication_Url', 'http://download.geofabrik.de/europe/germany-updates');
```
Now you will have a fully functioning nominatim instance available at : [http://localhost:7070/](http://localhost:7070). Unlike the previous versions
this one does not store data in the docker context and this results to a much slimmer docker image.
# Update
Full documentation for Nominatim update available [here](https://github.com/openstreetmap/Nominatim/blob/master/docs/Import-and-Update.md#updates). For a list of other methods see the output of:
```
docker exec -it nominatim sudo -u nominatim ./src/build/utils/update.php --help
```
The following command will keep your database constantly up to date:
```
docker exec -it nominatim sudo -u nominatim ./src/build/utils/update.php --import-osmosis-all
```
If you have imported multiple country extracts and want to keep them
up-to-date, have a look at the script in
[issue #60](https://github.com/openstreetmap/Nominatim/issues/60).