Skip to main content
Server settings apply to everything one Mirage server runs: its port, sign-in, rate limits, and the ceilings every workspace on it stays under. They are separate from workspace settings, which each workspace sets for itself. Each setting comes from the first of these that sets it:
  1. An option, for a Python or TypeScript server you start in code, or the Cloudflare app.
  2. Its environment variable, such as MIRAGE_MAX_SESSIONS.
  3. Its key in the [daemon] section of ~/.mirage/config.toml.
A server you start in code takes idle_grace_seconds only as an option (idleGraceSeconds in TypeScript); its default is 30. port, workers and worker_type are only for mirage daemon: in code, you serve the app yourself. The Cloudflare app has no config.toml. It reads only the sign-in settings and the six ceilings, max_workspaces to max_env, from options or the Worker’s variables. Its max_sessions defaults to 4.

Set a value

mirage daemon config edits ~/.mirage/config.toml:
The file then holds:
~/.mirage/config.toml
Changes apply on the next start. mirage daemon config get|unset|list read and remove keys.

Settings

Each key’s environment variable is MIRAGE_ and the key in capitals: max_sessions is MIRAGE_MAX_SESSIONS. Two keys are for the CLI, not the server. They tell mirage how to reach the server on this machine, its local context:
  • url, or MIRAGE_DAEMON_URL: http://127.0.0.1:PORT. mirage login URL adds another server.
  • auth_token, or MIRAGE_TOKEN: the token it sends. See Log in.
The server’s own token is MIRAGE_AUTH_TOKEN, else ~/.mirage/auth_token. It has no key in config.toml. See Configure authentication. MIRAGE_HOME sets the folder Mirage keeps its files in, ~/.mirage by default: config.toml, state/, snapshots/, the daemon’s log and the rest. It has no key in config.toml, because that file lives inside it.