Most of the MindsDB functionality can be modified by extending the default configuration, but some of the configuration options can be added as environment variables on the server where MindsDB is deployed.

MindsDB Authentication

MindsDB does not require authentication by default. If you want to enable authentication, you can set the MINDSDB_USERNAME and MINDSDB_PASSWORD environment variables.

Example

docker run --name mindsdb_container -e MINDSDB_USERNAME='mindsdb_user' -e MINDSDB_PASSWORD='mindsdb_password' -p 47334:47334 -p 47335:47335 mindsdb/mindsdb

MindsDB Storage

By default, MindsDB stores the configuration files by determining appropriate platform-specific directories, e.g. a “user data dir”:

  • On Linux ~/.local/share/mindsdb/var
  • On MacOS ~/Library/Application Support/mindsdb/var
  • On Windows C:\Documents and Settings\<User>\Application Data\Local Settings\<AppAuthor>\mindsdb\var

In the MINDSDB_STORAGE_DIR location, MindsDB stores users’ data, models and uploaded data files, the static assets for the frontend application and the sqlite.db file. You can change the default storage location using MINDSDB_STORAGE_DIR variable.

Example

docker run --name mindsdb_container -e MINDSDB_STORAGE_DIR='~/home/mindsdb/var' -p 47334:47334 -p 47335:47335 mindsdb/mindsdb

MindsDB Configuration Storage

MindsDB uses sqlite database by default to store the required configuration as models, projects, files metadata etc. The full list of the above schemas can be found here. You can change the default storage option and use different database by adding the new connection string using MINDSDB_DB_CON variable.

Example

docker run --name mindsdb_container -e MINDSDB_DB_CON='postgresql://user:secret@localhost' -p 47334:47334 -p 47335:47335 mindsdb/mindsdb

MindsDB APIs

By default, MindsDB starts the http and mysql APIs. To define which APIs you want to start, you can use the MINDSDB_APIS environment variable. To expose the ports for the APIs, you need to add the respective ports to the command with the -p flag.

Example

docker run --name mindsdb_container -e MINDSDB_APIS='http,mysql,mongodb,postgres' -p 47334:47334 -p 47335:47335 -p 47336:47336 -p 55432:55432 mindsdb/mindsdb

MindsDB Server

By default for the HTTP API, MindsDB uses Waitress which is a pure-Python WSGI server. There is an option to change that and use Flask or Gunicorn

Example

# To use Gunicorn as a default server, it should be installed by logging into the container
docker exec -it mindsdb_container sh  # assuming the container name is mindsdb_container  # assuming the container name is mindsdb_container
pip install gunicorn

docker run --name mindsdb_container -e MINDSDB_DEFAULT_SERVER='gunicorn' -p 47334:47334 -p 47335:47335 mindsdb/mindsdb

You can also use waitress, which is the default server or flask.

MindsDB Logs

This environment variable defines the level of logging generated by MindsDB. You can choose one of the values defined here. The INFO level is used by default.

Example

docker run --name mindsdb_container -e MINDSDB_LOG_LEVEL='DEBUG' -p 47334:47334 -p 47335:47335 mindsdb/mindsdb