Configure Meilisearch at launch with command-line options, environment variables, or a configuration file.
./meilisearch
is the command that launches a Meilisearch instance, while --db-path
and --http-addr
are options that modify this instance’s behavior.
Meilisearch also has a number of command-line flags. Unlike command-line options, flags don’t take values. If a flag is given, it is activated and changes Meilisearch’s default behavior.
--
.
./meilisearch
is the command that launches a Meilisearch instance, while MEILI_DB_PATH
and MEILI_HTTP_ADDR
are environment variables that modify this instance’s behavior.
Environment variables for command-line flags accept n
, no
, f
, false
, off
, and 0
as false
. An absent environment variable will also be considered as false
. Any other value is considered true
.
Environment variables are always identical to the corresponding command-line option, but prepended with MEILI_
and written in all uppercase.
.toml
format as an alternative to command-line options and environment variables. Configuration files can be easily shared and versioned, and allow you to define multiple options.
When used simultaneously, environment variables override the configuration file, and command-line options override environment variables.
You can download a default configuration file using the following command:
config.toml
file in the working directory. If it is present, it will be used as the configuration file. You can verify this when you launch Meilisearch:
Config file path
is anything other than "none"
, it means that a configuration file was successfully located and used to start Meilisearch.
You can override the default location of the configuration file using the MEILI_CONFIG_FILE_PATH
environment variable or the --config-file-path
CLI option:
--import-dump
would be written as import_dump
.
config_file_path
option within the configuration file will throw an error. This is the only configuration option that cannot be set within a configuration file./etc/systemd/system/meilisearch.service
.
To configure Meilisearch with environment variables in a cloud-hosted instance, modify Meilisearch’s env
file. Its default location is /var/opt/meilisearch/env
.
After editing your configuration options, relaunch the Meilisearch service:
MEILI_CONFIG_FILE_PATH
--config-file-path
./config.toml
MEILI_DB_PATH
--db-path
"data.ms/"
MEILI_ENV
--env
development
production
or development
Configures the instance’s environment. Value must be either production
or development
.
production
:
development
:
development
, providing a master key is not mandatory. This is useful when debugging and prototyping, but dangerous otherwise since API routes are unprotected.MEILI_HTTP_ADDR
--http-addr
"localhost:7700"
MEILI_MASTER_KEY
--master-key
None
GET /health
. This means you will need a valid API key to access all other endpoints.
When --env
is set to production
, providing a master key is mandatory. If none is given, or it is under 16 bytes, Meilisearch will throw an error and refuse to launch.
When --env
is set to development
, providing a master key is optional. If none is given, all routes will be unprotected and publicly accessible.
If you do not supply a master key in production
or development
environments or it is under 16 bytes, Meilisearch will suggest a secure autogenerated master key you can use when restarting your instance.
Learn more about Meilisearch’s use of security keys.
MEILI_NO_ANALYTICS
--no-analytics
Deactivates Meilisearch’s built-in telemetry when provided.
Meilisearch automatically collects data from all instances that do not opt out using this flag. All gathered data is used solely for the purpose of improving Meilisearch, and can be deleted at any time.
Read more about our policy on data collection, or take a look at the comprehensive list of all data points we collect.
MEILI_EXPERIMENTAL_DUMPLESS_UPGRADE
--experimental-dumpless-upgrade
MEILI_DUMP_DIR
--dump-dir
dumps/
MEILI_IMPORT_DUMP
--import-dump
.dump
file
Imports the dump file located at the specified path. Path must point to a .dump
file. If a database already exists, Meilisearch will throw an error and abort launch.
Meilisearch will only launch once the dump data has been fully indexed. The time this takes depends on the size of the dump file.
MEILI_IGNORE_MISSING_DUMP
--ignore-missing-dump
Prevents Meilisearch from throwing an error when --import-dump
does not point to a valid dump file. Instead, Meilisearch will start normally without importing any dump.
This option will trigger an error if --import-dump
is not defined.
MEILI_IGNORE_DUMP_IF_DB_EXISTS
--ignore-dump-if-db-exists
Prevents a Meilisearch instance with an existing database from throwing an error when using --import-dump
. Instead, the dump will be ignored and Meilisearch will launch using the existing database.
This option will trigger an error if --import-dump
is not defined.
MEILI_LOG_LEVEL
--log-level
'INFO'
ERROR
, WARN
, INFO
, DEBUG
, TRACE
, OR OFF
Defines how much detail should be present in Meilisearch’s logs.
Meilisearch currently supports five log levels, listed in order of increasing verbosity:
'ERROR'
: only log unexpected events indicating Meilisearch is not functioning as expected'WARN'
: log all unexpected events, regardless of their severity'INFO'
: log all events. This is the default value of --log-level
'DEBUG'
: log all events and include detailed information on Meilisearch’s internal processes. Useful when diagnosing issues and debugging'TRACE'
: log all events and include even more detailed information on Meilisearch’s internal processes. We do not advise using this level as it is extremely verbose. Use 'DEBUG'
before considering 'TRACE'
.'OFF'
: disable loggingMEILI_EXPERIMENTAL_LOGS_MODE
--experimental-logs-mode
'human'
human
or json
Defines whether logs should output a human-readable text or JSON data.
MEILI_MAX_INDEXING_MEMORY
--max-indexing-memory
104857600
) or a human readable size ('100Mb'
)
Sets the maximum amount of RAM Meilisearch can use when indexing. By default, Meilisearch uses no more than two thirds of available memory.
The value must either be given in bytes or explicitly state a base unit: 107374182400
, '107.7Gb'
, or '107374 Mb'
.
It is possible that Meilisearch goes over the exact RAM limit during indexing. In most contexts and machines, this should be a negligible amount with little to no impact on stability and performance.
--max-indexing-memory
to a value bigger than or equal to your machine’s total memory is likely to cause your instance to crash.MEILI_EXPERIMENTAL_REDUCE_INDEXING_MEMORY_USAGE
--experimental-reduce-indexing-memory-usage
None
MDB_WRITEMAP
, an LMDB option. Activating this option may reduce RAM usage in some UNIX and UNIX-like setups. However, it may also negatively impact write speeds and overall performance.
MEILI_MAX_INDEXING_THREADS
--max-indexing-threads
--max-indexing-threads
is higher than the real number of cores available in the machine, Meilisearch uses the maximum number of available cores.
In single-core machines, Meilisearch has no choice but to use the only core available for indexing. This may lead to a degraded search experience during indexing.
--max-indexing-threads
to the total of your machine’s processor cores. Though doing so might speed up indexing, it is likely to severely impact search experience.MEILI_HTTP_PAYLOAD_SIZE_LIMIT
--http-payload-size-limit
104857600
(~100MB)107374182400
, '107.7Gb'
, or '107374 Mb'
.
MEILI_EXPERIMENTAL_SEARCH_QUEUE_SIZE
--experimental-search-queue-size
1000
MEILI_EXPERIMENTAL_EMBEDDING_CACHE_ENTRIES
--experimental-embedding-cache-entries
0
MEILI_SCHEDULE_SNAPSHOT
--schedule-snapshot
86400
if present without a valueNone
or an integer
Activates scheduled snapshots. Snapshots are disabled by default.
It is possible to use --schedule-snapshot
without a value. If --schedule-snapshot
is present when launching an instance but has not been assigned a value, Meilisearch takes a new snapshot every 24 hours.
For more control over snapshot scheduling, pass an integer representing the interval in seconds between each snapshot. When --schedule-snapshot=3600
, Meilisearch takes a new snapshot every hour.
schedule_snapshot
. Meilisearch takes a new snapshot every 24 hours when schedule_snapshot=true
, and takes no snapshots when schedule_snapshot=false
.MEILI_SNAPSHOT_DIR
--snapshot-dir
snapshots/
MEILI_EXPERIMENTAL_NO_SNAPSHOT_COMPACTION
--experimental-no-snapshot-compaction
MEILI_IMPORT_SNAPSHOT
--import-snapshot
None
--ignore-snapshot-if-db-exists
and --ignore-missing-snapshot
options, respectively.
MEILI_IGNORE_MISSING_SNAPSHOT
--ignore-missing-snapshot
Prevents a Meilisearch instance from throwing an error when --import-snapshot
does not point to a valid snapshot file.
This command will throw an error if --import-snapshot
is not defined.
MEILI_IGNORE_SNAPSHOT_IF_DB_EXISTS
--ignore-snapshot-if-db-exists
Prevents a Meilisearch instance with an existing database from throwing an error when using --import-snapshot
. Instead, the snapshot will be ignored and Meilisearch will launch using the existing database.
This command will throw an error if --import-snapshot
is not defined.
MEILI_TASK_WEBHOOK_URL
--task-webhook-url
None
MEILI_TASK_WEBHOOK_AUTHORIZATION_HEADER
--task-webhook-authorization-header
None
MEILI_EXPERIMENTAL_MAX_NUMBER_OF_BATCHED_TASKS
--experimental-max-number-of-batched-tasks
None
MEILI_EXPERIMENTAL_LIMIT_BATCHED_TASKS_TOTAL_SIZE
--experimental-limit-batched-tasks-total-size
None
MEILI_EXPERIMENTAL_REPLICATION_PARAMETERS
--experimental-replication-parameters
None
TaskId
header to your API requestsDryRun: true
header in your requestMEILI_SSL_AUTH_PATH
--ssl-auth-path
None
MEILI_SSL_CERT_PATH
--ssl-cert-path
None
--ssl-key-path
. The last certificate should be a root CA.
MEILI_SSL_KEY_PATH
--ssl-key-path
None
MEILI_SSL_OCSP_PATH
--ssl-ocsp-path
None
MEILI_SSL_REQUIRE_AUTH
--ssl-require-auth
None
Makes SSL authentication mandatory.
Sends a fatal alert if the client does not complete client authentication.
MEILI_SSL_RESUMPTION
--ssl-resumption
None
Activates SSL session resumption.
MEILI_SSL_TICKETS
--ssl-tickets
None
Activates SSL tickets.