Runtime Options

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:

EnvironmentCLI FlagDefaultDescription
MEMOS_MODE--modeprodSets the mode of the server, influencing its runtime behavior and the database used. Can be prod (production), dev (development) or demo (demonstration).
MEMOS_ADDR--addr0.0.0.0 (all)Specifies the address on which the server will listen for incoming connections.
MEMOS_PORT--port5230Sets the port on which the server will be accessible.
MEMOS_DATA--data/var/opt/memosSpecifies the directory where Memos will store its data.
MEMOS_DRIVER--driversqliteSets the database driver to be used by Memos. Can be sqlite, postgres or mysql.
MEMOS_DSN--dsnSpecifies 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.