How to set Environment Variables containing JSON?

On the docs site there are some environment variables which require a string containing JSON:


Could someone share an example on how to set these properly?

My problem may be specific to MB_CUSTOM_GEOJSON, but I can't seem to find a format for the value which will actually be read by Metabase. The results are all parsing errors. I've been trying to just set the default value to start with:


Things I've tried:

  • The above as shown
  • The above without the first and last double quotes
  • The above with a single quote instead of the first and last double quotes
  • Escaping the double quotes with a backslash, with and without first and last quotes

When I look at /proc/*/environ for the Metabase process, the value is being set as specified. However I get either a parsing error at app startup like:

"type":"java.lang.ClassCastException","message":"class java.lang.String cannot be cast to class clojure.lang.IPersistentCollection (java.lang.String is in module java.base of loader 'bootstrap'; clojure.lang.IPersistentCollection is in unnamed module of loader 'app')"

or the value is not actually set in Metabase (as shown by /api/setting), rather it is "null". In this case Metabase can start up OK but the setting being null causes the /api/settings/maps to show a blank white screen, with the JS console saying TypeError: can't convert null to object.

Hi @lindsay-stevens
I've created two issues: - GeoJSON error - difficult to understand, when settings are applied

The easiest way to figure out what to define is by setting the options via the GUI and copy the value to an environment variable. There's so many different options available.

Also, you'll need to wrap the envvar value in single-quote, or escape the double-quotes inside.
Example: MB_APPLICATION_COLORS='{"brand":"#ff0080"}'