The following options can be set at runtime to configure the Memos server. These options can be set as environment variables or passed as command-line arguments when starting the server. Command-line arguments take precedence over environment variables. The options are listed below:
Environment | CLI Flag | Default | Description |
---|---|---|---|
MEMOS_MODE | --mode | prod | Sets the mode of the server, influencing its runtime behavior and the database used. Can be prod (production), dev (development) or demo (demonstration). |
MEMOS_ADDR | --addr | 0.0.0.0 (all) | Specifies the address on which the server will listen for incoming connections. |
MEMOS_PORT | --port | 5230 | Sets the port on which the server will be accessible. |
MEMOS_DATA | --data | /var/opt/memos | Specifies the directory where Memos will store its data. |
MEMOS_DRIVER | --driver | sqlite | Sets the database driver to be used by Memos. Can be sqlite, postgres or mysql. |
MEMOS_DSN | --dsn | Specifies the database source name (DSN) for connecting to the database. Note that each database driver has its own format for specifying the DSN. See the database documentation for more information. |
Important
Special characters in the DSN username and password must be escaped, such as converting =
to %3D
. Refer to the Connection URIs documentation for more details. Tools like URL Encoder can assist with this process.