Skip to content

Configuration Reference ​

All environment variables for the Kizuna server. Set these in .env before running docker compose up -d.

Required ​

VariableExampleDescription
DOMAINchat.example.comDomain with DNS A record pointing to your server. Caddy uses this for TLS.
JWT_SECRET(generated)Secret for signing auth tokens. Generate: openssl rand -hex 64

Server Identity ​

VariableDefaultDescription
SERVER_PORT5000Internal HTTP port (Caddy reverse-proxies to this). Not exposed externally.
SERVER_NAMEKizuna ServerDisplay name shown to clients.
SERVER_DESCRIPTIONA self-hosted Kizuna communityShort description.
SERVER_URL(auto)Public HTTPS URL. Used for invite links. Should match your domain.
SERVER_PASSWORD(none)Optional join password. If set, users must provide it to register.
CORS_ORIGIN(none)Extra origins allowed to call this server from a browser, comma-separated. The official web app (https://use-kizuna.com), the desktop app, and localhost dev servers are always allowed.

WebRTC / Voice ​

VariableDefaultDescription
PUBLIC_ADDRESS(auto via STUN)Public IP or hostname announced as WebRTC ICE candidate. Set this if auto-detection fails.
RTC_MIN_PORT40000Start of the media port range (UDP, with TCP as fallback). Each participant uses ~2 ports.
RTC_MAX_PORT40099End of the media port range. Increase if you expect 50+ concurrent voice users.
MEDIASOUP_LISTEN_IP0.0.0.0mediasoup listen address. Don't change this unless you know what you're doing.
MEDIASOUP_LOG_LEVELwarnmediasoup verbosity: debug, warn, error, none.

Features ​

VariableDefaultDescription
UPNP_ENABLEDfalseUPnP port mapping. Disable when using Docker/Caddy.
AUTO_TAGGING_ENABLEDfalseAI-powered GIF auto-tagging (CLIP model). Uses ~1.5 GB RAM.

Public Server Listing ​

VariableDefaultDescription
IS_PUBLICfalseList this server on the public server browser. Sends heartbeats every 60s.
ANNOUNCE_URLhttps://server.use-kizuna.comRegistry URL. Only used when IS_PUBLIC=true.
IS_REGISTRYfalseEnable registry endpoints. Only for running your own server browser.

Deployment ​

VariableDefaultDescription
KIZUNA_TAGlatestImage tag docker-compose.yml runs, e.g. v0.2.0. latest only ever points at a stable release. ./scripts/update.sh --pin <tag> sets this for you. Compose only; the server itself does not read it.
TRUST_PROXYtrue (compose)Trust X-Forwarded-For to find the client IP for rate limiting. On by default in the compose file because Caddy sits in front and overwrites the header. Set false if you expose the server directly, or clients can spoof their IP. Server default when unset: false.
NODE_ENVproduction (image)Set by the Docker image. Session cookies are always marked Secure in production, so serve the server over HTTPS (Caddy does this).

Advanced ​

VariableDefaultDescription
SERVER_DB_PATH/data/server.dbSQLite database path (inside container).
GIFS_DIR/app/uploads/gifsGIF/sticker storage directory.
MAX_GIF_SIZE5242880Max GIF file size in bytes (5 MB).
MAX_PACK_SIZE15728640Max sticker pack ZIP size in bytes (15 MB).
MAX_BODY_SIZE1048576Max request body size in bytes (1 MB).

Example: Production .env ​

bash
# Required
DOMAIN=chat.example.com
JWT_SECRET=$(openssl rand -hex 64)

# Server
SERVER_NAME=My Community
SERVER_DESCRIPTION=Welcome to our Kizuna server!

# Voice
PUBLIC_ADDRESS=chat.example.com
RTC_MIN_PORT=40000
RTC_MAX_PORT=40099

# Public listing (optional)
IS_PUBLIC=true