Configuration Reference

Mezite is configured through a YAML file, typically located at /etc/mezite/mezite.yaml. Every setting can also be overridden via environment variables. This page documents every field, its type, default value, and the corresponding environment variable.


Config Loading Order

Settings are resolved in the following order, with later sources taking precedence:

  1. Built-in defaults — Sensible values baked into the binary.
  2. Config file — Loaded from the path given by --config.
  3. Environment variables — Prefixed with MEZITE_, these override any value set in the config file.
Environment variables always win. This makes it easy to inject secrets (like database passwords and CA passphrases) without writing them to disk.

Minimal Config

The smallest useful configuration — just enough to start a combined-mode server with SQLite (the default):

mezite.yaml — minimal (SQLite) yaml
cluster_name: my-cluster

ssh:
  enabled: true

For PostgreSQL, set the driver and connection fields:

mezite.yaml — minimal (PostgreSQL) yaml
cluster_name: my-cluster

database:
  driver: postgres
  host: localhost
  port: 5432
  user: mezite
  password: mezite
  name: mezite
  sslmode: disable

ssh:
  enabled: true

Full Example

Below is a complete mezite.yaml with every field and its default value. In practice you only need to specify values that differ from the defaults.

mezite.yaml — complete reference yaml
# ─── Cluster ─────────────────────────────────────────────
cluster_name: my-cluster

# ─── Logging ─────────────────────────────────────────────
log:
  level: info
  format: json

# ─── Database ────────────────────────────────────────────
database:
  driver: sqlite          # sqlite (default) or postgres
  host: localhost          # PostgreSQL only
  port: 5432               # PostgreSQL only
  user: mezite             # PostgreSQL only
  password: mezite         # PostgreSQL only
  name: mezite             # PostgreSQL only
  sslmode: require         # PostgreSQL only

# ─── Auth Service ────────────────────────────────────────
auth:
  session_ttl: 12h
  grpc_allow_http: false

# Top-level: CA private key encryption passphrase
ca_key_passphrase: ""

# ─── Proxy Service ───────────────────────────────────────
proxy:
  public_addr: ""              # required for OIDC, WebAuthn, etc.
  listen_addr: 0.0.0.0:3080
  ssh_listen_addr: 0.0.0.0:3023
  tunnel_listen_addr: 0.0.0.0:3024

# ─── SSH Service ─────────────────────────────────────────
ssh:
  enabled: false

Cluster

FieldTypeDefaultEnv VarDescription
cluster_namestringmeziteMEZITE_CLUSTER_NAMEUnique identifier for this cluster. Embedded in all certificates and used to namespace audit events. Must be a valid DNS label.

Logging

FieldTypeDefaultEnv VarDescription
log.levelstringinfoMEZITE_LOG_LEVELMinimum log level. One of debug, info, warn, error.
log.formatstringjsonMEZITE_LOG_FORMATLog serialization format. json for structured output, text for human-readable.

Database

Mezite supports SQLite and PostgreSQL backends. SQLite is the simplest option for self-hosted deployments (zero external dependencies). PostgreSQL 16+ is recommended for production and managed deployments.

FieldTypeDefaultEnv VarDescription
database.driverstringsqliteMEZITE_DB_DRIVERDatabase backend: sqlite or postgres.
database.urlstring""MEZITE_DB_URLConnection URL. For SQLite: file path. For PostgreSQL: DSN. When empty, built from fields below (PG) or defaults to <data_dir>/mezhub.db (SQLite).
database.hoststringlocalhostMEZITE_DB_HOSTPostgreSQL hostname or IP address.
database.portinteger5432MEZITE_DB_PORTPostgreSQL port.
database.userstringmeziteMEZITE_DB_USERDatabase user (PostgreSQL only).
database.passwordstring""MEZITE_DB_PASSWORDDatabase password (PostgreSQL only).
database.namestringmeziteMEZITE_DB_NAMEName of the PostgreSQL database.
database.sslmodestringrequireMEZITE_DB_SSLMODEPostgreSQL TLS mode. Accepts: disable, require, verify-ca, verify-full.
SQLite (simplest — no external database) bash
export MEZITE_DB_DRIVER=sqlite
export MEZITE_DB_URL=/var/lib/mezite/mezhub.db
PostgreSQL (production) bash
export MEZITE_DB_DRIVER=postgres
export MEZITE_DB_HOST=db.internal.example.com
export MEZITE_DB_PORT=5432
export MEZITE_DB_USER=mezite
export MEZITE_DB_PASSWORD='$(vault kv get -field=password secret/mezite/db)'
export MEZITE_DB_NAME=mezite
export MEZITE_DB_SSLMODE=verify-full

Auth

Local username/password authentication is always available out of the box; SSO connectors (OIDC, SAML, LDAP, GitHub OAuth) are configured at runtime with mezctl connectors create, not via this YAML file. See the SSO Guide for the connector schema.

Certificate lifetimes are controlled per role via the role's max_session_ttl (default 12h), not by a global config key.

FieldTypeDefaultEnv VarDescription
auth.grpc_allow_httpbooleanfalseMEZITE_GRPC_ALLOW_HTTPAllow plaintext h2c (HTTP/2 cleartext) on the gRPC listener. Use only behind a TLS-terminating load balancer or service mesh.
ca_key_passphrase (top-level)string""MEZITE_CA_KEY_PASSPHRASEPassphrase used to encrypt Certificate Authority private keys at rest in the database.

Proxy

FieldTypeDefaultEnv VarDescription
proxy.public_addrstring""MEZITE_PROXY_PUBLIC_ADDRThe public address that clients use to reach this proxy (e.g. mezite.example.com:443). Required for OIDC discovery and WebAuthn enrollment URLs.
proxy.listen_addrstring0.0.0.0:3080--Bind address for the HTTPS listener.
proxy.ssh_listen_addrstring0.0.0.0:3023--Bind address for the SSH listener.
proxy.tunnel_listen_addrstring0.0.0.0:3024--Bind address for the reverse-tunnel listener.
proxy.oidc_issuer_urlstring""MEZITE_OIDC_ISSUER_URLPublic issuer URL surfaced at /.well-known/openid-configuration and used in workload-identity JWT SVIDs. No trailing slash.
proxy.trusted_ip_headerstring""--HTTP header to read real client IP from (e.g. Fly-Client-IP, X-Forwarded-For). Config-file only — there is no dedicated env var for this field.

SSH

FieldTypeDefaultEnv VarDescription
ssh.enabledbooleanfalse--Enable the built-in SSH service on this node.

Port Reference

PortProtocolComponentDescription
3025gRPCAuth ServiceInternal auth API. Should not be exposed publicly.
3080HTTPSProxy ServiceWeb UI, REST API, OIDC callbacks.
3023SSHProxy ServiceSSH client connections via msh.
3024gRPCProxy ServiceAgent reverse-tunnel connections.
5432PostgreSQLDatabaseState store (only when using PostgreSQL backend).

Agent Configuration

The mezd binary is configured entirely via environment variables.

VariableRequiredDescription
MEZITE_JOIN_TOKENYes (first run)One-time join token. Only needed on first join.
MEZITE_AUTH_ADDRYesAddress of the Auth service (e.g. mezite.example.com:3025).
MEZITE_PROXY_ADDRYesAddress of the Proxy tunnel listener (e.g. mezite.example.com:3024).
MEZITE_NODE_NAMENoNode name shown in msh ls. Defaults to hostname.
MEZITE_NODE_LABELSNoComma-separated key=value labels for RBAC matching (e.g. env=prod,role=web).
MEZITE_DATA_DIRNoData directory for identity and recordings. Default: /var/lib/mezite.
MEZITE_RECORDING_MODENoRecording mode: node (default — async upload after session) or node-sync (real-time streaming to the auth service). See Session Recording.
MEZITE_TLS_WRAPNoWrap tunnel connection in TLS. Required when connecting through a TLS-terminating load balancer. See Reverse Proxy.
MEZITE_BPF_ENABLEDNoEnable eBPF enhanced recording (Linux only, requires privileged mode). Captures command executions in addition to terminal I/O.
MEZITE_PAM_SERVICENoPAM service name for session hooks (Linux only).
MEZITE_AUTH_H2CNoRun gRPC auth in h2c (HTTP/2 cleartext) mode. Use when a TLS-terminating load balancer sits in front (Fly.io, ALB, Istio/Linkerd service mesh). Also suitable for local development.
Agent startup example bash
MEZITE_JOIN_TOKEN=d4f8a2e1-7b3c-4d9e-a5f6-1234567890ab \
MEZITE_AUTH_ADDR=mezite.example.com:3025 \
MEZITE_PROXY_ADDR=mezite.example.com:3024 \
MEZITE_NODE_NAME=web-server-01 \
MEZITE_NODE_LABELS="env=production,role=webserver" \
mezd start

Environment Variables

VariableConfig EquivalentDescription
MEZITE_CLUSTER_NAMEcluster_nameCluster name
MEZITE_DB_DRIVERdatabase.driverDatabase backend (sqlite or postgres)
MEZITE_DB_URLdatabase.urlConnection URL (file path for SQLite, DSN for PostgreSQL)
MEZITE_DB_HOSTdatabase.hostPostgreSQL host
MEZITE_DB_PORTdatabase.portPostgreSQL port
MEZITE_DB_USERdatabase.userPostgreSQL user
MEZITE_DB_PASSWORDdatabase.passwordPostgreSQL password
MEZITE_DB_NAMEdatabase.namePostgreSQL database name
MEZITE_DB_SSLMODEdatabase.sslmodePostgreSQL TLS mode
MEZITE_LOG_LEVELlog.levelLog verbosity
MEZITE_LOG_FORMATlog.formatLog format (json or text)
MEZITE_CA_KEY_PASSPHRASEca_key_passphrase (top-level)CA private key encryption passphrase
MEZITE_AUTH_H2C-Run gRPC in h2c mode (required behind a TLS-terminating LB). Process-level env var read directly by mezhub at startup; not a config-file field.
MEZITE_GRPC_ALLOW_HTTPauth.grpc_allow_httpAllow plaintext h2c on the gRPC listener (also enabled by MEZITE_AUTH_H2C).
MEZITE_PROXY_PUBLIC_ADDRproxy.public_addrPublic proxy address for OIDC discovery and WebAuthn origin
MEZITE_OIDC_ISSUER_URLproxy.oidc_issuer_urlPublic issuer URL surfaced at /.well-known/openid-configuration. No trailing slash.
MEZITE_AUDIT_HMAC_KEYaudit_hmac_key (top-level)Hex-encoded HMAC key for the audit-log tamper-detection chain.
MEZITE_RECORDING_BACKENDrecording.backendRecording storage backend: local (default) or s3
MEZITE_S3_BUCKETrecording.s3.bucketS3 bucket for recording storage
MEZITE_S3_REGIONrecording.s3.regionS3 region (default: us-east-1)
MEZITE_S3_ENDPOINTrecording.s3.endpointCustom S3 endpoint (for MinIO or other S3-compatible stores)
MEZITE_RECORDING_ENC_KEYrecording_enc_key (top-level)32-byte hex-encoded AES-256 key for recording encryption at rest
Example: SQLite with env vars (simplest self-hosted) bash
MEZITE_CLUSTER_NAME=production \
MEZITE_DB_DRIVER=sqlite \
MEZITE_DB_URL=/var/lib/mezite/mezhub.db \
MEZITE_LOG_LEVEL=info \
MEZITE_CA_KEY_PASSPHRASE='another-secret' \
mezhub
Example: PostgreSQL with env vars bash
MEZITE_CLUSTER_NAME=production \
MEZITE_DB_HOST=db.internal.example.com \
MEZITE_DB_PORT=5432 \
MEZITE_DB_USER=mezite \
MEZITE_DB_PASSWORD='hunter2' \
MEZITE_DB_NAME=mezite \
MEZITE_DB_SSLMODE=verify-full \
MEZITE_LOG_LEVEL=info \
MEZITE_LOG_FORMAT=json \
MEZITE_CA_KEY_PASSPHRASE='another-secret' \
mezhub

Production Config

SSO connectors are not configured in mezite.yaml — create them at runtime with mezctl connectors create once the hub is up. See the SSO Guide.

mezite.yaml — production yaml
cluster_name: production

log:
  level: info
  format: json

database:
  driver: postgres
  host: db.internal.example.com
  port: 5432
  user: mezite
  # password set via MEZITE_DB_PASSWORD
  name: mezite
  sslmode: verify-full

auth:
  session_ttl: 8h

# ca_key_passphrase set via MEZITE_CA_KEY_PASSPHRASE

proxy:
  public_addr: mezite.example.com:443
  listen_addr: 0.0.0.0:3080
  ssh_listen_addr: 0.0.0.0:3023
  tunnel_listen_addr: 0.0.0.0:3024
  oidc_issuer_url: https://mezite.example.com

ssh:
  enabled: false  # dedicated proxy node, not an SSH target

Next Steps

  • Quickstart — Apply this configuration in a working setup.
  • Architecture — Understand how auth, proxy, and agent components interact.
  • SSH Access Guide — Deep dive into SSH certificate authentication and session recording.
  • SSO Guide — Configure OIDC or SAML authentication.