Configuration

The config of the FacilMap server can be set either by using environment variables (useful for docker) or by editing config.env.

VariableRequiredMeaning
USER_AGENT*Will be used for all HTTP requests (search, routing, GPX/KML/OSM/GeoJSON files). You better provide your e-mail address in here.
APP_NAMEIf specified, will replace “FacilMap” as the name of the app throughout the UI.
TRUST_PROXYWhether to trust the X-Forwarded-* headers. Can be true or a comma-separated list of IP subnets (see the express documentationopen in new window). Currently only used to calculate the base URL for the opensearch.xml file.
BASE_URLIf TRUST_PROXY does not work for your particular setup, you can manually specify the base URL where FacilMap can be publicly reached here.
HOSTThe ip address to listen on (leave empty to listen on all addresses)
PORTThe port to listen on.

Default: 8080
DB_TYPEThe type of database. Either mysql, postgres, mariadb, sqlite, or mssql.

Default: mysql
DB_HOSTThe host name of the database server.

Default: localhost
DB_PORTThe port of the database server (optional).
DB_NAMEThe name of the database.

Default: facilmap
DB_USERThe username to connect to the database with.

Default: facilmap
DB_PASSWORDThe password to connect to the database with.

Default: facilmap
ORS_TOKENOpenRouteService API keyopen in new window. If not specified, advanced routing settings will not be shown.
MAPBOX_TOKENMapbox API keyopen in new window. If neither this nor ORS_TOKEN are specified, the routing tab and any routing options will be hidden.
MAXMIND_USER_IDMaxMind user IDopen in new window.
MAXMIND_LICENSE_KEYMaxMind license key.
LIMA_LABS_TOKENLima Labsopen in new window API key (for Lima Labs map style)
THUNDERFOREST_TOKENThunderforestopen in new window API key (for OpenCycleMap map style)
TRACESTRACK_TOKENTracestrackopen in new window API key (for Tracestrack Topo map style)
HIDE_COMMERCIAL_MAP_LINKSSet to 1 to hide the links to Google/Bing Maps in the “Map style” menu.
CUSTOM_CSS_FILEThe path of a CSS file that should be included (see more details below).
NOMINATIM_URLThe URL to the Nominatim server (used to search for places).

Default: https://nominatim.openstreetmap.org
OPEN_ELEVATION_URLThe URL to the Open Elevation server (used to look up the elevation for markers).

Default: https://api.open-elevation.com
OPEN_ELEVATION_THROTTLE_MSThe minimum time between two requests to the Open Elevation API. Set to 0 if you are using your own self-hosted instance of Open Elevation.

Default: 1000
OPEN_ELEVATION_MAX_BATCH_SIZEThe maximum number of points to resolve in one request through the Open Elevation API. Set this to 1000 if you are using your own self-hosted Open Elevation instance.

Default: 200
DONATE_URLDefine a custom target for the “Donate” button. If you decide to link your own donation page to cover the costs of your hosting, consider mentioning FacilMap’s donation page there for the costs of the development of the software. You can also set this to an empty string to completely hide the donation button.

Default: https://docs.facilmap.org/users/contribute/

FacilMap makes use of several third-party services that require you to register (for free) and generate an API key:

  • Mapbox and OpenRouteService are used for calculating routes. Mapbox is used for basic routes, OpenRouteService is used when custom route mode settings are made. If these API keys are not defined, calculating routes will fail.
  • Maxmind provides a free database that maps IP addresses to approximate locations. FacilMap downloads this database to decide the initial map view for users (IP addresses are looked up in FacilMap’s copy of the database, on IP addresses are sent to Maxmind). This API key is optional, if it is not set, the default view will be the whole world.
  • Lima Labs is used for nicer and higher resolution map tiles than Mapnik. The API key is optional, if it is not set, Mapnik will be the default map style instead.

Custom CSS file

To include a custom CSS file in the UI, set the CUSTOM_CSS_FILE environment variable to the file path.

When running FacilMap with docker, you can mount your CSS file as a volume into the container, for example with the following docker-compose configuration:

		environment:
			CUSTOM_CSS_FILE: /opt/facilmap/custom.css
		volumes:
			- ./custom.css:/opt/facilmap/custom.css

Your custom CSS file will be included in the map UI and in the table export. You can distinguish between the two by using the html.fm-facilmap-map and html.fm-facilmap-table selectors.