Docs

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.

What it consists of

ServiceWhat it doesRequired
Federation serverAccounts, chats, messages, media, call signaling, bots, link pagesyes
PostgreSQL 17All federation data except media filesyes
Sign-in service (OIDC)Checks who signs in. Keycloak in the ready-made stack; you can plug in your ownyes
HTTPS proxyTLS and routing. Caddy with a Let's Encrypt certificate in the ready-made stackyes
TURN (coturn)Helps direct calls get through NATfor calls
SFUMedia server for group calls and voice roomsfor group calls
Push relayPasses encrypted notifications to Apple, Google and browsersfor background notifications
Web clientComon in the browser at /app/no
Speech recognizerTranscribes voice messagesno
BridgeBroadcasts public Telegram channelsno

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:
PortProtocolFor
443TCPHTTPS and the apps' WebSocket, certificate issuance (TLS-ALPN)
3478TCP and UDPTURN
49160–49200UDPCall traffic relayed by TURN
7882UDPGroup call media (SFU)
5349TCPTURN 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

  1. The tools/mvp-stack.py script builds and runs the whole stack in Docker Compose: the server, PostgreSQL, Keycloak, Caddy, TURN and the SFU, and with its enable-* commands push, the bridge and speech recognition. The quick start uses it.
  2. 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.yaml in the repository is an example of such a setup (Traefik and an external OIDC provider).

Section map

Configuration

Reference

Operations

On this page