3 This page contains generic installation instructions for Nominatim and its
4 prerequisites. There are also step-by-step instructions available for
5 the following operating systems:
7 * [Ubuntu 24.04](../appendix/Install-on-Ubuntu-24.md)
8 * [Ubuntu 22.04](../appendix/Install-on-Ubuntu-22.md)
10 These OS-specific instructions can also be found in executable form
11 in the `vagrant/` directory.
13 Users have created instructions for other frameworks. We haven't tested those
14 and can't offer support.
16 * [Docker](https://github.com/mediagis/nominatim-docker)
17 * [Docker on Kubernetes](https://github.com/peter-evans/nominatim-k8s)
18 * [Kubernetes with Helm](https://github.com/robjuz/helm-charts/blob/master/charts/nominatim/README.md)
19 * [Ansible](https://github.com/synthesio/infra-ansible-nominatim)
26 For larger installations you **must have** PostgreSQL 11+ and PostGIS 3+
27 otherwise import and queries will be slow to the point of being unusable.
28 Query performance has marked improvements with PostgreSQL 13+ and PostGIS 3.2+.
30 For running Nominatim:
32 * [PostgreSQL](https://www.postgresql.org) (9.6+ will work, 11+ strongly recommended)
33 * [PostGIS](https://postgis.net) (2.2+ will work, 3.0+ strongly recommended)
34 * [osm2pgsql](https://osm2pgsql.org) (1.8+, optional when building with CMake)
35 * [Python 3](https://www.python.org/) (3.7+)
37 Furthermore the following Python libraries are required:
39 * [Psycopg2](https://www.psycopg.org) (2.7+)
40 * [Python Dotenv](https://github.com/theskumar/python-dotenv)
41 * [psutil](https://github.com/giampaolo/psutil)
42 * [Jinja2](https://palletsprojects.com/p/jinja/)
43 * [SQLAlchemy](https://www.sqlalchemy.org/) (1.4.31+ with greenlet support)
45 * [psycopg3](https://www.psycopg.org)
46 * [asyncpg](https://magicstack.github.io/asyncpg) (0.8+)
47 * [PyICU](https://pypi.org/project/PyICU/)
48 * [PyYaml](https://pyyaml.org/) (5.1+)
49 * [datrie](https://github.com/pytries/datrie)
51 These will be installed automatically, when using pip installation.
53 When using legacy CMake-based installation:
55 * [cmake](https://cmake.org/)
56 * [expat](https://libexpat.github.io/)
57 * [proj](https://proj.org/)
58 * [bzip2](http://www.bzip.org/)
59 * [zlib](https://www.zlib.net/)
60 * [ICU](http://site.icu-project.org/)
61 * [nlohmann/json](https://json.nlohmann.me/)
62 * [Boost libraries](https://www.boost.org/), including system and file system
63 * PostgreSQL client libraries
64 * a recent C++ compiler (gcc 5+ or Clang 3.8+)
66 For running continuous updates:
68 * [pyosmium](https://osmcode.org/pyosmium/)
70 For running the Python frontend:
72 * one of the following web frameworks:
73 * [falcon](https://falconframework.org/) (3.0+)
74 * [starlette](https://www.starlette.io/)
75 * [uvicorn](https://www.uvicorn.org/)
77 For running the legacy PHP frontend:
79 * [PHP](https://php.net) (7.3+)
81 * PHP-intl (bundled with PHP)
84 For dependencies for running tests and building documentation, see
85 the [Development section](../develop/Development-Environment.md).
89 A minimum of 2GB of RAM is required or installation will fail. For a full
90 planet import 128GB of RAM or more are strongly recommended. Do not report
91 out of memory problems if you have less than 64GB RAM.
93 For a full planet install you will need at least 1TB of hard disk space.
94 Take into account that the OSM database is growing fast.
95 Fast disks are essential. Using NVME disks is recommended.
97 Even on a well configured machine the import of a full planet takes
98 around 2.5 days. When using traditional SSDs, 4-5 days are more realistic.
100 ## Tuning the PostgreSQL database
102 You might want to tune your PostgreSQL installation so that the later steps
103 make best use of your hardware. You should tune the following parameters in
104 your `postgresql.conf` file.
107 maintenance_work_mem = (10GB)
108 autovacuum_work_mem = 2GB
110 synchronous_commit = off
112 checkpoint_timeout = 60min
113 checkpoint_completion_target = 0.9
114 random_page_cost = 1.0
118 The numbers in brackets behind some parameters seem to work fine for
119 128GB RAM machine. Adjust to your setup. A higher number for `max_wal_size`
120 means that PostgreSQL needs to run checkpoints less often but it does require
121 the additional space on your disk.
123 Autovacuum must not be switched off because it ensures that the
124 tables are frequently analysed. If your machine has very little memory,
125 you might consider setting:
127 autovacuum_max_workers = 1
129 and even reduce `autovacuum_work_mem` further. This will reduce the amount
130 of memory that autovacuum takes away from the import process.
132 ## Downloading and building Nominatim
134 ### Downloading the latest release
136 You can download the [latest release from nominatim.org](https://nominatim.org/downloads/).
137 The release contains all necessary files. Just unpack it.
139 ### Downloading the latest development version
141 If you want to install latest development version from github, make sure to
142 also check out the osm2pgsql subproject:
145 git clone --recursive https://github.com/openstreetmap/Nominatim.git
148 The development version does not include the country grid. Download it separately:
151 wget -O Nominatim/data/country_osm_grid.sql.gz https://nominatim.org/data/country_grid.sql.gz
154 ### Building Nominatim
156 #### Building the latest development version with pip
158 To install Nominatim directly from the source tree, run:
160 pip install packaging/nominatim-{core,db,api}
162 #### Building in legacy CMake mode
165 Installing Nominatim through CMake is now deprecated. The infrastructure
166 will be removed in Nominatim 5.0. Please switch to pip installation.
168 The code must be built in a separate directory. Create the directory and
176 Nominatim uses cmake and make for building. Assuming that you have created the
177 build at the same level as the Nominatim source directory run:
186 The default installation no longer compiles the PostgreSQL module that
187 is needed for the legacy tokenizer from older Nominatim versions. If you
188 are upgrading an older database or want to run the
189 [legacy tokenizer](../customize/Tokenizers.md#legacy-tokenizer) for
190 some other reason, you need to enable the PostgreSQL module via
191 cmake: `cmake -DBUILD_MODULE=on ../Nominatim`. To compile the module
192 you need to have the server development headers for PostgreSQL installed.
193 On Ubuntu/Debian run: `sudo apt install postgresql-server-dev-<postgresql version>`
196 Nominatim installs itself into `/usr/local` per default. To choose a different
197 installation directory add `-DCMAKE_INSTALL_PREFIX=<install root>` to the
198 cmake command. Make sure that the `bin` directory is available in your path
202 export PATH=<install root>/bin:$PATH
205 Now continue with [importing the database](Import.md).