1 This page contains generic installation instructions for Nominatim and its
2 prerequisites. There are also step-by-step instructions available for
3 the following operating systems:
5 * [Ubuntu 16.04](../appendix/Install-on-Ubuntu-16.md)
6 * [CentOS 7.2](../appendix/Install-on-Centos-7.md)
8 These OS-specific instructions can also be found in executable form
9 in the `vagrant/` directory.
11 Users have created instructions for other frameworks. We haven't tested those
12 and can't offer support.
14 * [Docker](https://github.com/mediagis/nominatim-docker)
15 * [Docker on Kubernetes](https://github.com/peter-evans/nominatim-k8s)
16 * [Ansible](https://github.com/synthesio/infra-ansible-nominatim)
24 * [cmake](https://cmake.org/)
25 * [libxml2](http://xmlsoft.org/)
26 * a recent C++ compiler
28 Nominatim comes with its own version of osm2pgsql. See the
29 osm2pgsql README for additional dependencies required for compiling osm2pgsql.
33 * [behave](http://pythonhosted.org/behave/)
34 * [Psycopg2](http://initd.org/psycopg)
35 * [nose](https://nose.readthedocs.io)
36 * [phpunit](https://phpunit.de)
38 For running Nominatim:
40 * [PostgreSQL](http://www.postgresql.org) (9.1 or later)
41 * [PostGIS](http://postgis.refractions.net) (2.0 or later)
42 * [PHP](http://php.net) (5.4 or later)
44 * PHP-intl (bundled with PHP)
45 * [PEAR::DB](http://pear.php.net/package/DB)
46 * a webserver (apache or nginx are recommended)
48 For running continuous updates:
50 * [pyosmium](http://osmcode.org/pyosmium/)
54 A minimum of 2GB of RAM is required or installation will fail. For a full
55 planet import 32GB of RAM or more strongly are recommended.
57 For a full planet install you will need about 600GB of hard disk space (as of
58 January 2017, take into account that the OSM database is growing fast). SSD disks
59 will help considerably to speed up import and queries.
61 On a 6-core machine with 32GB RAM and SSDs the import of a full planet takes
62 a bit more than 2 days. Without SSDs 7-8 days are more realistic.
69 You might want to tune your PostgreSQL installation so that the later steps
70 make best use of your hardware. You should tune the following parameters in
71 your `postgresql.conf` file.
74 maintenance_work_mem (10GB)
76 effective_cache_size (24GB)
77 synchronous_commit = off
78 checkpoint_segments = 100 # only for postgresql <= 9.4
79 checkpoint_timeout = 10min
80 checkpoint_completion_target = 0.9
82 The numbers in brackets behind some parameters seem to work fine for
83 32GB RAM machine. Adjust to your setup.
85 For the initial import, you should also set:
88 full_page_writes = off
90 Don't forget to reenable them after the initial import or you risk database
91 corruption. Autovacuum must not be switched off because it ensures that the
92 tables are frequently analysed.
96 The `website/` directory in the build directory contains the configured
97 website. Include the directory into your webbrowser to serve php files
100 ### Configure for use with Apache
102 Make sure your Apache configuration contains the required permissions for the
103 directory and create an alias:
105 <Directory "/srv/nominatim/build/website">
106 Options FollowSymLinks MultiViews
107 AddType text/html .php
108 DirectoryIndex search.php
111 Alias /nominatim /srv/nominatim/build/website
113 `/srv/nominatim/build` should be replaced with the location of your
116 After making changes in the apache config you need to restart apache.
117 The website should now be available on http://localhost/nominatim.
119 ### Configure for use with Nginx
121 Use php-fpm as a deamon for serving PHP cgi. Install php-fpm together with nginx.
123 By default php listens on a network socket. If you want it to listen to a
124 Unix socket instead, change the pool configuration (`pool.d/www.conf`) as
127 ; Comment out the tcp listener and add the unix socket
128 ;listen = 127.0.0.1:9000
129 listen = /var/run/php5-fpm.sock
131 ; Ensure that the daemon runs as the correct user
132 listen.owner = www-data
133 listen.group = www-data
136 Tell nginx that php files are special and to fastcgi_pass to the php-fpm
137 unix socket by adding the location definition to the default configuration.
139 root /srv/nominatim/build/website;
140 index search.php index.html;
141 location ~ [^/]\.php(/|$) {
142 fastcgi_split_path_info ^(.+?\.php)(/.*)$;
143 if (!-f $document_root$fastcgi_script_name) {
146 fastcgi_pass unix:/var/run/php5-fpm.sock;
147 fastcgi_index search.php;
148 include fastcgi.conf;
151 Restart the nginx and php5-fpm services and the website should now be available
152 at `http://localhost/`.
155 Now continue with [importing the database](Import-and-Update.md).