Sophon 2.0 is here
Sophon Docs
Self-Hosting

Configuration Reference

Complete reference for environment variables, internal configuration, data directory layout, and tier behavior.

Environment Variables

These variables are set in your .env file and read by Docker Compose.

VariableDefaultTiersDescription
SOPHON_DATArequiredAllAbsolute path to host data directory. No ~ expansion — use full path. Forward slashes on Windows.
DOCKER_GID999All (Linux)Docker socket group ID. Find with getent group docker | cut -d: -f3
GATEWAY_PORT8081AllHost port for the Gateway API
DASHBOARD_PORT8080AllHost port for the Dashboard UI
POSTGRES_USERsophonPro, EnterprisePostgreSQL username
POSTGRES_PASSWORDsophonPro, EnterprisePostgreSQL password — change in production
POSTGRES_PORT5432Pro, EnterpriseHost port for PostgreSQL
QDRANT_HTTP_PORT6333Pro, EnterpriseHost port for Qdrant HTTP API
QDRANT_GRPC_PORT6334Pro, EnterpriseHost port for Qdrant gRPC
REDIS_PORT6379EnterpriseHost port for Redis
REDIS_PASSWORDsophonEnterpriseRedis password — change in production
RABBITMQ_USERsophonEnterpriseRabbitMQ username
RABBITMQ_PASSWORDsophonEnterpriseRabbitMQ password — change in production
RABBITMQ_PORT5672EnterpriseHost port for RabbitMQ AMQP
RABBITMQ_MGMT_PORT15672EnterpriseHost port for RabbitMQ management UI
VAULT_PROVIDERlocalEnterpriseCredential vault backend (local, hashicorp, aws, azure)
VAULT_ADDRESShttp://vault:8200EnterpriseHashiCorp Vault address
VAULT_TOKEN(empty)EnterpriseHashiCorp Vault token
JWT_SECRET(empty)EnterpriseJWT signing secret for multi-user auth
SSO_ENABLEDfalseEnterpriseEnable SSO/OIDC authentication

Internal Environment Variables

These are set inside the compose files and should not be changed in .env. They configure the gateway container's internal behavior.

VariableValueDescription
SOPHON__TierPersonal / Pro / EnterpriseFeature tier — controls which features are enabled
SOPHON__Databasesqlite / postgresqlDatabase backend. Personal uses SQLite; Pro/Enterprise use PostgreSQL.
SOPHON__DataDirectory/home/sophon/.sophonContainer-internal path where the data volume is mounted
SOPHON__Sandbox__HostWorkspacesPath${SOPHON_DATA}/sandbox/workspacesHost path for sandbox bind mounts (must be accessible from the Docker daemon)
ConnectionStrings__PostgreSQLHost=postgres;...PostgreSQL connection string (Pro/Enterprise)
Qdrant__Endpointhttp://qdrant:6334Qdrant gRPC endpoint (Pro/Enterprise)
Sophon__Redis__ConnectionStringredis:6379,...Redis connection with password (Enterprise)
Sophon__MessageBus__ProviderrabbitmqMessage bus backend (Enterprise)
SOPHON_GATEWAY_URLhttp://sophon-gateway:8080Internal URL the Dashboard uses to reach the Gateway

Application Settings

These keys are set in config/appsettings.user.json inside the data directory. Each can also be set as an environment variable by replacing : with __ (e.g. SOPHON__Plugins__Enabled=true).

KeyDefaultDescription
Sophon:Plugins:EnabledfalseMaster switch for the out-of-process plugin host. Plugins run as full-trust local processes — leave disabled unless you install plugins from sources you trust.
Sophon:Plugins:Allow(empty)Optional allowlist of plugin names. Empty means every discovered plugin may load (when plugins are enabled); when set, only listed plugins start.
Sophon:Memory:RetentionDays30Daily logs older than this are deleted by the consolidation job's retention sweep.
Sophon:Memory:Consolidation:EnabledtrueEnable the scheduled job that promotes durable daily-log facts into long-term memory entries.
Sophon:Memory:Consolidation:Schedule0 0 3 * * ?Quartz 6-field cron expression for the consolidation job. Default: daily at 03:00 UTC.
Sophon:Memory:Consolidation:LookbackDays2How many days of recent daily logs each run considers, per owner.
Sophon:Memory:Consolidation:MinLogsToConsolidate5Owners with fewer logs than this in the lookback window are skipped for the run.
Sophon:Memory:Consolidation:MaxFactsPerRun20Upper bound on how many facts a single run promotes for one owner.
Sophon:AgentExecution:PlanApprovalAlwaysHost-wide default for plan approval on interactive sessions (Always, ElevatedRisk, Never). Live-reloaded — no restart needed. Also editable at Settings → Security → Approvals.

Voice

Host-wide tunables for the speech engine, under Sophon:Voice. These are operator settings: everything a user controls (language, speech speed, input and output mode, conversation mode, endpointing, max utterance) is a per-user preference in Voice Center, not a config key. See Voice Settings.

KeyDefaultDescription
Sophon:Voice:SpeakProgressUpdatestrueMaster switch for the short spoken progress line during long, multi-step work. Set false to keep long tool runs silent.
Sophon:Voice:NarrationGapSeconds12Seconds of silence — no new assistant text — before a progress line becomes eligible.
Sophon:Voice:NarrationIntervalSeconds20Minimum spacing between two spoken progress lines.
Sophon:Voice:MaxSpokenSentenceChars280Sentences longer than this are split at clause boundaries before synthesis, so speech starts sooner.
Sophon:Voice:NodeWake:EnabledfalseMaster switch for the node-token voice routes (/api/nodes/me/voice/runtime, /state, /wake). All three return 404 until this is true — no shipped client calls them.
Sophon:Voice:NodeWake:MaxTranscriptChars2000A longer wake transcript is rejected before it can become a prompt. Applies to /wake only.
Sophon:Voice:NodeWake:EventsPerMinute6Wake events allowed per node per minute, and the burst size. Read at startup only — changing it needs a Gateway restart.
Sophon:Voice:HealthMonitor:EnabledtrueBackground health sweep over every configured speech provider.
Sophon:Voice:HealthMonitor:IntervalMinutes15How often the sweep runs. A provider is marked failing after two consecutive failed sweeps and recovers on one success, so an outage can take roughly half an hour to surface on the Voice page. Status is held in memory and resets to active on restart.

Sophon:Voice:BargeInMinWords exists in the configuration shape but is reserved — nothing reads it. There is no automatic speech-triggered barge-in in this release; interrupting is a mic press. See Voice Limits.

Sophon:Voice:NodeWake:Enabled is the one voice key with real security surface: the /wake route runs a full agent turn as the node's owner, from a transcript the node supplies. Turning it on also needs the node's voice.runtime scope, which isn't granted by default. Read Sophon Node permissions first.

Data Directory Layout

All Sophon runtime state lives in SOPHON_DATA on the host (mounted at /home/sophon/.sophon inside the container):

~/.sophon/
├── config/
│   ├── appsettings.user.json     # User-level configuration overrides
│   ├── models.json               # LLM provider configs (API keys encrypted)
│   ├── channels.json             # Channel connections (encrypted)
│   ├── tts.json                  # Text-to-speech provider list (non-secret)
│   └── stt.json                  # Speech-to-text providers + host listening defaults
├── agents/
│   └── default/
│       ├── SOUL.md               # Agent personality
│       ├── BOOT.md               # First-run init script
│       ├── HEARTBEAT.md          # Heartbeat checklist
│       └── TOOLS.md              # Available tools config
├── skills/
│   ├── bundled/                  # Ships with Sophon (read-only)
│   ├── installed/                # From Marketplace
│   └── self-authored/            # Created by the agent
├── memory/
│   ├── daily/                    # Short-term daily logs
│   ├── MEMORY.md                 # Long-term curated facts
│   └── entities/                 # Structured entity store
├── documents/
│   ├── uploads/                  # User-uploaded files
│   ├── processed/                # Extracted text and embeddings
│   └── index/                    # Search index (FTS + vector)
├── cron/
│   └── jobs.json                 # Scheduled jobs
├── workflows/
│   └── *.json                    # Workflow definitions
├── sandbox/
│   └── workspaces/               # Ephemeral code execution (auto-cleaned)
├── security/
│   └── vault.key                 # AES-256 encryption key — CRITICAL, back up!
├── logs/
│   └── sophon-YYYYMMDD.log       # Application logs (rotated daily)
└── data/
    ├── sophon.db                 # SQLite database (Personal tier only)
    └── cache/                    # Local cache (thumbnails, embeddings)

The security/vault.key file is the AES-256 encryption key used to encrypt credentials at rest. Without this file, encrypted credentials cannot be decrypted. Always include it in backups.

tts.json and stt.json hold non-secret configuration only — the provider id, display name, provider type, endpoint or region, voice id, priority and last health status. Provider API keys live in the credential vault; each entry stores a credential id, not a key. stt.json also carries the host-wide listening defaults that a user's personal overrides fall back to.

Tier Behavior

FeaturePersonalProEnterprise
DatabaseSQLite (embedded)PostgreSQL 17PostgreSQL 17
AuthenticationAuto-admin (single user)JWT multi-userJWT + SSO/OIDC
Credential EncryptionAES-256 (vault.key)AES-256 (vault.key)External vault (HashiCorp/AWS/Azure)
Vector Store(none)QdrantQdrant
CacheIn-memoryIn-memoryRedis 7
Message BusIn-processIn-processRabbitMQ 4.0
Multi-Tenancy(none)(none)Full tenant isolation
Audit Logging(none)(none)Full audit trail
RBAC(none)Basic rolesFull RBAC + custom roles
Horizontal ScalingSingle instanceSingle instanceMultiple replicas (K8s)

Changing tiers is a configuration change — the same binary, different feature flags. Set SOPHON__Tier in your compose file to switch.

First-Run Behavior

On first startup, Sophon:

  1. Creates the data directory if SOPHON_DATA doesn't exist on the host
  2. Seeds the default agent — creates agents/default/SOUL.md with a starter personality
  3. Runs database migrations — creates the SQLite database (Personal) or migrates PostgreSQL (Pro/Enterprise)
  4. Generates vault.key — creates the encryption key for credential storage
  5. Enters Setup Mode — the Dashboard shows the Setup Wizard to configure your first LLM provider

No manual migration step is ever needed. EF Core migrations run automatically on startup.