Skip to main content

Configuration Reference

qui supports configuration via:

  • config.toml (auto-created on first run, or manually via qui generate-config)
  • environment variables (QUI__...) to override config.toml

This page documents both in one place.

Precedence

Highest wins:

  1. QUI__*_FILE (for supported secrets)
  2. QUI__* environment variables
  3. config.toml
  4. built-in defaults

Config File Location

Default config.toml locations:

  • Linux/macOS: ~/.config/qui/config.toml
  • Windows: %APPDATA%\\qui\\config.toml

Override with --config-dir:

  • directory path: --config-dir /path/to/config/ (uses /path/to/config/config.toml)
  • file path (back-compat): --config-dir /path/to/custom.toml

Notes On Reloading

qui watches config.toml for changes. Some settings are applied immediately (for example logging, tracker icon fetching, and auth-disabled settings). For anything else, restart qui after changes to be safe.

Settings

TOML keyEnvironment variableTypeDefaultNotes
hostQUI__HOSTstringlocalhost (or 0.0.0.0 in containers)Bind address for the main HTTP server.
portQUI__PORTint7476Port for the main HTTP server.
baseUrlQUI__BASE_URLstring/Serve qui from a subdirectory (example: /qui/).
corsAllowedOriginsQUI__CORS_ALLOWED_ORIGINSstring[]empty listExplicit CORS allowlist. Empty disables CORS. Origins must be http(s)://host[:port]; wildcards are rejected; default ports are normalized. Restart required.
sessionSecretQUI__SESSION_SECRET / QUI__SESSION_SECRET_FILEstringauto-generatedWARNING: changing breaks decryption of stored instance passwords; you must re-enter them in the UI.
logLevelQUI__LOG_LEVELstringINFOERROR, DEBUG, INFO, WARN, TRACE. Applied immediately.
logPathQUI__LOG_PATHstringemptyIf empty: logs to stdout. Relative paths resolve relative to the config directory. Applied immediately.
logMaxSizeQUI__LOG_MAX_SIZEint50MiB threshold before rotation. Applied immediately.
logMaxBackupsQUI__LOG_MAX_BACKUPSint3Rotated files retained. 0 keeps all. Applied immediately.
dataDirQUI__DATA_DIRstringemptyIf empty: uses the directory containing config.toml. Always used for non-database assets (logs, tracker icon cache, etc.). When databaseEngine=sqlite, qui.db also lives here. Restart recommended.
databaseEngineQUI__DATABASE_ENGINEstringsqlitesqlite or postgres. Existing installs should keep sqlite unless you migrate. Restart required.
databaseDsnQUI__DATABASE_DSN / QUI__DATABASE_DSN_FILEstringemptyFull Postgres DSN. Preferred when databaseEngine=postgres.
databaseHostQUI__DATABASE_HOSTstringlocalhostPostgres host when not using databaseDsn.
databasePortQUI__DATABASE_PORTint5432Postgres port when not using databaseDsn.
databaseUserQUI__DATABASE_USERstringemptyPostgres user when not using databaseDsn.
databasePasswordQUI__DATABASE_PASSWORD / QUI__DATABASE_PASSWORD_FILEstringemptyPostgres password when not using databaseDsn.
databaseNameQUI__DATABASE_NAMEstringquiPostgres database name when not using databaseDsn.
databaseSSLModeQUI__DATABASE_SSL_MODEstringdisableCommon values: disable, require, verify-ca, verify-full.
databaseConnectTimeoutQUI__DATABASE_CONNECT_TIMEOUTint10Postgres connect timeout in seconds.
databaseMaxOpenConnsQUI__DATABASE_MAX_OPEN_CONNSint25Postgres pool max open connections.
databaseMaxIdleConnsQUI__DATABASE_MAX_IDLE_CONNSint5Postgres pool max idle connections.
databaseConnMaxLifetimeQUI__DATABASE_CONN_MAX_LIFETIMEint300Postgres connection max lifetime in seconds.
checkForUpdatesQUI__CHECK_FOR_UPDATESbooltrueControls update checks and UI indicators. Restart recommended.
trackerIconsFetchEnabledQUI__TRACKER_ICONS_FETCH_ENABLEDbooltrueDisable to prevent remote tracker favicon fetches. Applied immediately.
crossSeedRecoverErroredTorrentsQUI__CROSS_SEED_RECOVER_ERRORED_TORRENTSboolfalseWhen enabled, cross-seed automation attempts recovery (pause, recheck, resume) for errored/missingFiles torrents. Can add 25+ minutes per torrent. Restart recommended.
pprofEnabledQUI__PPROF_ENABLEDboolfalseEnables pprof server on :6060 (/debug/pprof/). Restart required.
metricsEnabledQUI__METRICS_ENABLEDboolfalseEnables a Prometheus metrics server (separate port). Restart required.
metricsHostQUI__METRICS_HOSTstring127.0.0.1Metrics server bind address. Restart required.
metricsPortQUI__METRICS_PORTint9074Metrics server port. Restart required.
metricsBasicAuthUsersQUI__METRICS_BASIC_AUTH_USERSstringemptyOptional basic auth: user:bcrypt_hash or user1:hash1,user2:hash2. Restart required.
externalProgramAllowList(none)string[]empty listRestricts which executables can be launched from the UI. Only configurable via config.toml (no env override).
authDisabledQUI__AUTH_DISABLEDboolfalseDisable all built-in authentication. Both this and I_ACKNOWLEDGE_THIS_IS_A_BAD_IDEA must be true for auth to be disabled. See Authentication below. Applied on config reload.
I_ACKNOWLEDGE_THIS_IS_A_BAD_IDEAQUI__I_ACKNOWLEDGE_THIS_IS_A_BAD_IDEAboolfalseRequired confirmation for authDisabled. Acknowledges that running without authentication can lead to unauthorized access to your torrent clients and potential bans from private trackers. Applied on config reload.
authDisabledAllowedCIDRsQUI__AUTH_DISABLED_ALLOWED_CIDRSstring[]empty listRequired when auth is disabled. Restricts access to specific client IPs/CIDRs. Entries may be canonical CIDRs or single IPs. Applied on config reload.
oidcEnabledQUI__OIDC_ENABLEDboolfalseEnable OpenID Connect authentication. Restart required.
oidcIssuerQUI__OIDC_ISSUERstringemptyOIDC issuer URL. Restart required.
oidcClientIdQUI__OIDC_CLIENT_IDstringemptyOIDC client ID. Restart required.
oidcClientSecretQUI__OIDC_CLIENT_SECRET / QUI__OIDC_CLIENT_SECRET_FILEstringemptyOIDC client secret. Restart required.
oidcRedirectUrlQUI__OIDC_REDIRECT_URLstringemptyMust match the provider redirect URI (include baseUrl when reverse proxying). Restart required.
oidcDisableBuiltInLoginQUI__OIDC_DISABLE_BUILT_IN_LOGINboolfalseHide local username/password form when OIDC is enabled. Restart required.

Authentication

To disable qui's built-in authentication, all of the following are required:

QUI__AUTH_DISABLED=true
QUI__I_ACKNOWLEDGE_THIS_IS_A_BAD_IDEA=true
QUI__AUTH_DISABLED_ALLOWED_CIDRS=127.0.0.1/32,192.168.1.0/24

The second variable exists as an explicit acknowledgement of the risks.

QUI__AUTH_DISABLED_ALLOWED_CIDRS is mandatory and acts as a hard IP allowlist. If auth is disabled and the value is missing/invalid, qui will refuse to start and reject invalid live reloads.

Entries can be:

  • Canonical CIDR ranges (192.168.1.0/24)
  • Single IPs (10.0.0.5), automatically treated as /32 (IPv4) or /128 (IPv6)

Non-canonical CIDRs with host bits set (for example 10.0.0.5/8) are rejected.

oidcEnabled and auth-disabled mode cannot be enabled at the same time.

When authentication is disabled:

  • Requests are allowed only if the direct client IP matches authDisabledAllowedCIDRs.
  • Built-in health endpoints (/health, /healthz/readiness, /healthz/liveness) still allow loopback probes so the official Docker image healthcheck works without adding 127.0.0.1/32 or ::1/128 to your reverse proxy allowlist.
  • /api/auth/me returns a synthetic admin user so the frontend works without login.
  • /api/auth/validate returns a synthetic admin user so callback/session checks work without login.
  • The setup screen is skipped entirely.

Only use this if qui is behind a reverse proxy that already handles authentication (e.g., Authelia, Authentik, Caddy with forward_auth).

Private tracker risks

If you use private trackers, running qui without authentication is especially dangerous. Anyone with network access can control your torrent clients — adding, removing, or modifying torrents. Actions performed by unauthorized users (hit-and-runs, ratio manipulation, uploading unwanted content) can get your accounts permanently banned from private trackers, with no way to recover.

If QUI__AUTH_DISABLED is set without QUI__I_ACKNOWLEDGE_THIS_IS_A_BAD_IDEA, qui will log a warning and keep authentication enabled.

CORS

By default, qui does not send CORS allow headers. To allow browser requests from another trusted origin, set corsAllowedOrigins (or QUI__CORS_ALLOWED_ORIGINS) to an explicit allowlist:

QUI__CORS_ALLOWED_ORIGINS=https://sso.example.com,https://panel.example.com

Rules:

  • only explicit origins are allowed (http:// or https:// + host + optional non-default port)
  • wildcards are rejected (*, https://*.example.com, etc.)
  • path/query/fragment/userinfo are rejected
  • invalid values refuse startup; invalid live reloads are rejected and keep the last valid allowlist

For SSO proxy setups, prefer configuring CORS on the proxy auth endpoints first. See SSO Proxies and CORS.

Example config.toml

host = "0.0.0.0"
port = 7476
baseUrl = "/qui/"

logLevel = "INFO"
logPath = "log/qui.log"
logMaxSize = 50
logMaxBackups = 3

trackerIconsFetchEnabled = false

externalProgramAllowList = [
"/usr/local/bin",
"/home/user/bin/my-script",
]