Skip to main content

Environment Variables

Mantrae provides several command-line flags and environment variables to configure the application. This guide details each option and its purpose.

Command-Line Arguments

You can use the following flags to customize the behavior of Mantrae:

FlagTypeDefaultDescription
-versionboolfalsePrints the current version of Mantrae and exits.
-updateboolfalseUpdates Mantrae to the latest version. (Doesn't work inside a container)

Environment Variables

Environment variables can be used to set up Mantrae and configure its settings. Below is a list of the supported environment variables.

Core Configuration

VariableDefaultDescription
SECRETSecret key required for secure access. Required!

Server Configuration

VariableDefaultDescription
SERVER_HOST0.0.0.0Host address the server will bind to
SERVER_PORT3000Port which Mantrae will listen on
SERVER_URLhttp://127.0.0.1The public URL of the Mantrae server for agent connections
SERVER_BASIC_AUTHfalseEnables basic authentication for the Mantrae server

Traefik Configuration

VariableDefaultDescription
TRAEFIK_PROFILEdefaultTraefik profile name
TRAEFIK_URLTraefik API URL
TRAEFIK_USERNAMETraefik authentication username
TRAEFIK_PASSWORDTraefik authentication password
TRAEFIK_TLSfalseEnable TLS for Traefik

Example Usage

To run Mantrae with custom environment variables:

export SECRET="your-secret-key"
export SERVER_PORT="4000"
export ADMIN_PASSWORD="secure-password"
./mantrae

Important Notes

  • SECRET is a required environment variable and must be set; otherwise, the application will not start.
  • Set SERVER_URL to the publicly accessible URL of Mantrae to ensure agents can connect to it.