Self-hosting
What a Comon federation consists of, what you need to install one, and where every setting lives.
A federation is your organization's Comon server, with its own people, chats and rules. Comon apps connect to any federation by its address, so running your own server needs no app build of your own: people install the regular Comon app and add your federation.
Quick start
From a clean Linux machine with a domain to the first sign-in from the app.
Server options
Every server and gateway option: its default and what it changes.
Calls
TURN, the media server for group calls, ports and NAT.
Push notifications
How notifications reach phones and browsers, and what that takes.
Federation settings
Roles, rules, filters, reports, guests and limits, right in the app.
Backups
How to take a backup and restore the federation on another machine.
What it consists of
| Service | What it does | Required |
|---|---|---|
| Federation server | Accounts, chats, messages, media, call signaling, bots, link pages | yes |
| PostgreSQL 17 | All federation data except media files | yes |
| Sign-in service (OIDC) | Checks who signs in. Keycloak in the ready-made stack; you can plug in your own | yes |
| HTTPS proxy | TLS and routing. Caddy with a Let's Encrypt certificate in the ready-made stack | yes |
| TURN (coturn) | Helps direct calls get through NAT | for calls |
| SFU | Media server for group calls and voice rooms | for group calls |
| Push relay | Passes encrypted notifications to Apple, Google and browsers | for background notifications |
| Web client | Comon in the browser at /app/ | no |
| Speech recognizer | Transcribes voice messages | no |
| Bridge | Broadcasts public Telegram channels | no |
How they fit together: how the server works.
Requirements
- A machine with Linux, Docker Engine and Docker Compose v2, Python 3.11 or newer, and git. Docker needs at least 4 GB of memory. Server images are built from source on the same machine.
- A domain whose A record points at the machine. The address of the federation and of its sign-in service is part of its identity: changing the domain after people have signed in is a procedure of its own (moving to another domain).
- A public IPv4 address and open ports:
| Port | Protocol | For |
|---|---|---|
| 443 | TCP | HTTPS and the apps' WebSocket, certificate issuance (TLS-ALPN) |
| 3478 | TCP and UDP | TURN |
| 49160–49200 | UDP | Call traffic relayed by TURN |
| 7882 | UDP | Group call media (SFU) |
| 5349 | TCP | TURN over TLS, if enabled |
- Memory, CPU and disk for your number of people: work them out with the calculator. By default each person may store 50 GiB of media and the whole server 1 TiB; options change both (limits).
- For speech recognition on the CPU, another 1.3 GB or so for models and up to four threads.
The stack in the repository is meant for an organization's private installation. It does not set up open registration for anyone: a public launch needs its own preparation of monitoring, capacity and abuse controls.
Two ways to install
- The
tools/mvp-stack.pyscript builds and runs the whole stack in Docker Compose: the server, PostgreSQL, Keycloak, Caddy, TURN and the SFU, and with itsenable-*commands push, the bridge and speech recognition. The quick start uses it. - Your own setup. If you already have a reverse proxy, a sign-in service or a database, run
the same images with your own options. Every option is in the reference;
deploy/hosted/compose.yamlin the repository is an example of such a setup (Traefik and an external OIDC provider).
Section map
Configuration
- Sign-in and accounts: Keycloak, your own OIDC, cloud password, phone numbers.
- Calls: TURN, SFU, ports, NAT, TURN over TLS.
- Push notifications: relay, APNs, FCM, Web Push.
- Web client and links: the web client, link pages, opening links in the apps.
- Voice transcription.
- Bots and bridges.
- App versions: required and recommended updates.
- Federation settings: owner, roles, rules, filters, limits.
Reference
- Sizing: a calculator based on measurements.
- Server options.
- Limits.
Operations
- Operations: health checks, logs, offline commands, error reports.
- Backups and restore.
- Upgrading.
- Scaling: gateways, NATS, a shared media volume.
- Troubleshooting.