Configuration

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

VariableRequiredDefaultMeaning
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)
PORT8080The port to listen on.
DB_TYPEmysqlThe type of database. Either mysql, postgres, mariadb, sqlite, or mssql.
DB_HOSTlocalhostThe host name of the database server.
DB_PORTThe port of the database server (optional).
DB_NAMEfacilmapThe name of the database.
DB_USERfacilmapThe username to connect to the database with.
DB_PASSWORDfacilmapThe password to connect to the database with.
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
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_URLhttps://nominatim.openstreetmap.orgThe URL to the Nominatim server (used to search for places).
OPEN_ELEVATION_URLhttps://api.open-elevation.comThe URL to the Open Elevation server (used to look up the elevation for markers).
OPEN_ELEVATION_THROTTLE_MS1000The 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.
OPEN_ELEVATION_MAX_BATCH_SIZE200The 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.

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.