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
SERVER_ENABLE_AGENTtrueEnables the Mantrae agent functionality
SERVER_LOG_LEVELinfoLog verbosity level

Admin Configuration

VariableDefaultDescription
ADMIN_USERNAMEadminAdmin user username
ADMIN_EMAILadmin@mantraeAdmin user email
ADMIN_PASSWORDAdmin user password

Email Configuration

VariableDefaultDescription
EMAIL_HOSTlocalhostSMTP server host
EMAIL_PORT587SMTP server port
EMAIL_USERNAMESMTP server username
EMAIL_PASSWORDSMTP server password
EMAIL_FROMmantrae@localhostSender email address

Database Configuration

VariableDefaultDescription
DB_TYPEsqliteDatabase type. Supported options: only sqlite for now
DB_NAMEmantraeDatabase/file name

Backup Configuration

VariableDefaultDescription
BACKUP_ENABLEDtrueEnable automatic backups
BACKUP_PATHbackupsDirectory for storing backups
BACKUP_INTERVAL24hInterval between backups
BACKUP_KEEP3Number of backups to keep

Traefik Configuration

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

Background Jobs Configuration

VariableDefaultDescription
BACKGROUND_JOBS_TRAEFIK20Traefik background job interval
BACKGROUND_JOBS_DNS300DNS background job interval

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.