Skip to content
slukedevPublic

About

XMPP in a box. One Rust binary, or one small container, that is a complete, fast, modern, and efficient chat server

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

7 stars

Watchers

0 watching

Forks

Quark

XMPP in a box. One Rust binary, or one small container, that is a complete, modern chat server.

CI License: GPL-3.0-or-later

The dashboard's overview: everything is working, devices and server links flowing through the server, live traffic, and counts of people, groups and invites.

Accounts and invites, group chats, history on every device, photos and files, push to phones, calls with a built-in relay, federation and web chat. Settings change live, certificates reload themselves, and everything is managed through one JSON admin API, which is how Gluon runs it.

It works with the apps people use: Conversations, Monal, Siskin, Gajim, Dino, Cheogram, Movim, Converse.js, Profanity, Poezio and the rest. Compatibility is checked against real client code, not just Quark's own test client (see Tested with).

Quark runs on Linux. It is free software under the GNU GPL, version 3 or later.

At a glance

  • Everything in one process: chat, group chats, uploads, push, a STUN/TURN call relay, WebSocket and BOSH web chat, invite pages with QR codes.
  • Live settings: every chat setting applies at once, nothing needs a restart, and certificates hot-reload from a folder or come from Let's Encrypt.
  • A dashboard at /dashboard for admins and members, signed in with a chat account.
  • Self-updates for the binary and the Docker image, with checksum checks, a test run and rollback.
  • One admin API: typed JSON over a Unix socket, quark ctl, optional HTTP, and an MCP server (quark mcp) so AI assistants can manage it with the same tools.
  • Made for phones: SASL2, Bind2 and FAST for quick reconnects, stream management, CSI batching and push with the priority hints Monal and Siskin use.

Run it

With the image, :0.4 for the latest release or :edge for the newest commit on main:

docker run -d --name quark \
  -e QUARK_DOMAIN=chat.example.com -e [email protected] \
  -v quark-config:/etc/quark -v quark-data:/var/lib/quark \
  -p 5222:5222 -p 5223:5223 -p 5269:5269 -p 5280:5280 \
  -p 3478:3478 -p 3478:3478/udp -p 49160-49200:49160-49200/udp \
  ghcr.io/slukedev/quark:0.4
echo '{"cmd":"account.create","args":{"host":"chat.example.com","user":"you","password":"a long password","role":"admin"}}' \
  | docker exec -i quark quark ctl

docker build -t quark . builds the same image from a checkout. Or download a binary for x86_64 or aarch64 Linux from the releases, or build one (Rust 1.89 or newer; Node.js LTS for the dashboard UI, optional):

(cd web && npm ci && npm run build)   # optional: embeds the dashboard
cargo build --release
./target/release/quark --config quark.toml

On first start without a config, Quark writes a starter one from QUARK_DOMAIN and QUARK_ADMINS. Put a real certificate in /etc/quark/certs/<domain>.crt and .key (Gluon copies Caddy's for you), or let Quark get one from Let's Encrypt with [acme] (docs/config.md); until then it uses a self-signed one.

Point DNS (and ideally the SRV records _xmpp-client._tcp, _xmpps-client._tcp and _xmpp-server._tcp) at the box, and a TLS proxy such as Caddy at port 5280 for web chat, uploads and invite pages.

Updates

Quark updates itself, in the image too (it keeps updates on the quark-data volume). In the dashboard, open Settings > Updates, pick a track, Stable for tagged releases or Edge for every commit on main (recommended for now), and turn on automatic updates. Pulling a newer image still wins.

Host it on Fly.io

The repository's fly.toml runs everything on one Fly.io Machine: chat apps, federation, calls, web chat and the dashboard, with Let's Encrypt certificates Quark renews itself.

fly launch --from https://github.com/slukedev/quark --into quark --copy-config --no-deploy --ha=false

Then follow docs/fly.md: a dedicated IPv4 for calls, the domain, DNS records and the first admin account.

With Gluon

Gluon installs Quark as its default chat server (Apps → Chat server), creates the first admin account, publishes the chat domain through Caddy, copies the certificate in, and gives you screens for accounts, devices, invites with QR codes, group chats, settings and calls. It talks to Quark with quark ctl inside the container; see docs/admin-api.md and docs/gluon-contract.md.

Dashboard

The dashboard lives at https://<your chat domain>/dashboard. Sign in with a chat account and its password, the same ones your chat app uses. Admins see how the server is doing and manage people, invites, group chats, every chat setting (applied live), updates and the config file. Members see their own devices, dashboard sessions and password, and can invite friends when sign-up allows it.

People: every account with its role, devices online and when it was last active. Settings: who can sign up, passwords, message history and group chats.

Updates: the running build, the Edge build that is ready with its commits, and the track and automatic update settings. Signing in with a chat address and password.

It is built into the binary and the image, and served only by Quark itself. docs/dashboard.md explains how sign-in, sessions and updates work. To work on it:

cd web && npm ci
npm run dev   # against a built-in mock server
npm test && npm run typecheck && npm run lint && npm run e2e

What it supports

Core (RFC 6120/6121/7622): STARTTLS and direct TLS (XEP-0368), SASL PLAIN and SCRAM-SHA-1/256/512 with -PLUS channel binding (tls-exporter, tls-server-end-point, XEP-0440) and downgrade detection, rosters with versioning and pre-approval, the full presence subscription state machine, message routing with priorities.

Modern sign-in: SASL2 (XEP-0388), Bind2 (XEP-0386) with inline carbons/CSI/stream management, FAST tokens (XEP-0484) for one-round-trip reconnects, in-band registration (XEP-0077) with invites (XEP-0401, XEP-0379, XEP-0445).

Mobile: stream management with resumption (XEP-0198), client state indication (XEP-0352) with server-side batching, push (XEP-0357) with priority hints Monal and Siskin use, message carbons (XEP-0280), offline messages (XEP-0160). Optionally a push app server of its own on push.<domain> (registration like Conversations' p2), which hands signed, content-free wake-ups to an APNs or FCM gateway.

History: message archive management (XEP-0313, incl. extended and full-text search), stable stanza ids (XEP-0359), retention that follows the history setting.

Group chats: XEP-0045 with archives, occupant ids (XEP-0421), self-ping (XEP-0410), moderation (XEP-0425), room avatars, persistent rooms, direct and mediated invites.

Personal eventing: PEP/PubSub (XEP-0163/0060) with entity caps (XEP-0115), publish-options and access models: OMEMO keys (legacy and OMEMO 2, listed and removed per device by admins), avatars (XEP-0084, synced with vCard XEP-0398), nicknames, bookmarks 2 (XEP-0402, synced with legacy XEP-0048/0411), vCard4.

Files and web: HTTP file upload (XEP-0363) with quotas and optional photo metadata stripping, WebSocket (RFC 7395), BOSH (XEP-0206), host-meta (XEP-0156), invite landing pages with QR codes.

Calls: a built-in STUN/TURN relay (RFC 8489/8656) with external service discovery (XEP-0215) handing out short-lived credentials; or point it at coturn.

Federation: server-to-server with SRV and direct TLS, PKIX certificates and SASL EXTERNAL, dialback (XEP-0220/0185), stream management on links.

Also: blocking (XEP-0191), spam reports (XEP-0377), vcard-temp (XEP-0054), private storage (XEP-0049), disco (XEP-0030/0128), contact addresses (XEP-0157), ad-hoc commands with service administration (XEP-0050/0133), ping, time, version, last activity, account export/import (XEP-0227).

What it doesn't support

Server-side XEPs Quark doesn't implement, checked against the XMPP Compliance Suites 2023 and what people ask for.

Not yet:

  • XEP-0114 Jabber Component Protocol and XEP-0225 Component Connections: no external components; group chats and uploads are built in.
  • XEP-0355 Namespace Delegation and XEP-0356 Privileged Entity, which build on components.
  • XEP-0060 as a standalone PubSub service (pubsub.example.com) and XEP-0248 collection nodes: PubSub lives on accounts (PEP) only.
  • XEP-0065 SOCKS5 Bytestreams proxy for file transfers.
  • XEP-0369 MIX, XEP-0405 MIX-PAM and XEP-0376 PAM: group chats are MUC.
  • XEP-0288 Bidirectional Server-to-Server Connections.
  • XEP-0133 Service Administration in full: user rosters, last login, statistics, MOTD and welcome messages, block lists, restart and shutdown commands are missing.
  • XEP-0033 Extended Stanza Addressing.
  • XEP-0055 Jabber Search (a user directory).
  • XEP-0317 Hats: rooms drop hats clients send and hand out none.
  • XEP-0433 Extended Channel Search and XEP-0437 Room Activity Indicators.
  • XEP-0474 SASL SCRAM Downgrade Protection and XEP-0515 TLS Channel-Binding Downgrade Protection (SCRAM's own -PLUS downgrade check is there).
  • XEP-0478 Stream Limits Advertisement.
  • XEP-0480 SASL Upgrade Tasks, XEP-0509 Initial Authentication Pipelining and XEP-0520 SASL2 Terms of Service Acceptance Task.
  • XEP-0493 OAuth Client Login and XEP-0494 Client Access Management.
  • XEP-0397 Instant Stream Resumption (deferred; FAST and stream management cover reconnects).
  • XEP-0455 Service Outage Status, XEP-0485 PubSub Server Information, XEP-0489 Reporting Account Affiliations and XEP-0503 Server-side Spaces.

Left out on purpose:

  • XEP-0078 Non-SASL Authentication: obsolete, replaced by SASL.
  • XEP-0016 Privacy Lists: deprecated in favour of blocking (XEP-0191).
  • XEP-0136 Message Archiving: deprecated in favour of MAM (XEP-0313).
  • XEP-0013 Flexible Offline Message Retrieval: deprecated.
  • XEP-0138 Stream Compression: obsolete, and compressing under TLS leaks what's inside.
  • XEP-0079 Advanced Message Processing: next to no client uses it.

Up to clients: chat markers (XEP-0333), retraction (XEP-0424), replies (XEP-0461), reactions (XEP-0444), stateless file sharing (XEP-0447/0448), Jingle calls and file transfer (XEP-0166/0167/0234/0353), call invites (XEP-0482), WebXDC (XEP-0491) and notification settings (XEP-0492) need nothing more from a server than routing, archiving and push, which Quark does.

Beyond other servers

On top of what's under At a glance:

  • A built-in call relay, so calls work across networks without a separate coturn.
  • No passwords stored, only SCRAM keys; usernames can't be probed through SCRAM.
  • Write batching per connection, CSI batching on phones, backpressure on slow clients and fast ones, bounded queues everywhere, compressed archives with SQLite FTS5 search.
  • Uploads can strip location and camera data from photos as they stream in (http.strip_photo_metadata).
  • Stranger filter: link-carrying messages from unknown remote senders are rate-limited and never wake phones.

Tested with

Besides its own protocol suite (about 600 tests that drive a real server over the wire), Quark is checked with the libraries real apps are built on:

Client code Used by Covers
XMPP Interop Testing (Smack) Smack-based apps; the suite Openfire, ejabberd and Prosody run ~900 tests across RFC 6120/6121, MUC, PubSub, MAM, SM, SASL2, FAST, Bind2 (CI)
slixmpp, aioxmpp Poezio, bots 140+ scenarios: every XEP above, two libraries talking to each other
Converse.js, Strophe.js, xmpp.js web chat WebSocket, BOSH, XEP-0156 discovery, CORS, OMEMO, uploads in a real browser
libstrophe Profanity STARTTLS, direct TLS, TLS 1.2 and 1.3, stream resumption
python-nbxmpp Gajim SASL2, bookmarks, OMEMO, vCard4
tokio-xmpp, xmpp-rs Rust clients sign-in, MUC, bookmarks, MAM, resumption
mellium, go-xmpp Go clients, go-sendxmpp every SASL mechanism, SASL2, Bind2, FAST
loudmouth mcabber legacy sign-in and sessions

docs/interop.md explains how to run these. Found an app that misbehaves? Open an issue with the app and its version.

Layout

Crate What's in it
crates/core XML, JIDs, stanzas
crates/server the server and the quark binary
crates/mcp MCP tools
crates/testkit a real server on random ports plus a raw client; the protocol test suite lives in crates/testkit/tests

More in docs/architecture.md, docs/config.md and docs/testing.md.

cargo test --workspace
cargo clippy --workspace --all-targets -- -D warnings

Contributions are welcome: read CONTRIBUTING.md.

License

Copyright (C) 2026 Luke and contributors.

Quark is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; see LICENSE for details.

About

XMPP in a box. One Rust binary, or one small container, that is a complete, fast, modern, and efficient chat server

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

7 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages