Install a server
One Linux box, Docker, a DNS name, and two ports. This page is the first thirty minutes: what to install, the command that starts it, and the checks that tell you it is actually serving.
git clone does not work yet. Everything below is what the shipped deploy/ directory does once it does; the flags and file names are current today.1. What you need
- A Linux machine with Docker and the compose plugin. Debian 12 or Ubuntu 24.04 is what the deploy notes use; an Oracle Cloud Always Free ARM VM (1 OCPU, 6 GB) is enough to start.
- A DNS name you control, with an
Arecord pointing at the box. Keep it DNS only (grey cloud) if you use Cloudflare: a proxied record would make Cloudflare decrypt everything, which is the thing you are avoiding by running your own server. - Ports
80and443reachable from the internet. Port 80 is not optional: it is how the certificate is issued.
If the box is fresh, deploy/vps-setup.sh installs Docker, opens 80/443 in the machine's own firewall and turns on unattended security upgrades:
ssh ubuntu@VM_IP 'sudo sh -s' < deploy/vps-setup.sh
2. Start it
git clone https://github.com/foreski/Yap
cd Yap/deploy
YAP_DOMAIN=chat.example.com docker compose up -d
The first build compiles the server, which takes a few minutes on a small ARM box. Every start after that is seconds.
3. What that started
| Piece | Details |
|---|---|
yap | The Rust server. Not published to the host at all: only Caddy can reach it, on the compose network at port 8080. Runs as an unprivileged user with a read-only root filesystem, all capabilities dropped and no-new-privileges. |
caddy | Publishes 80 and 443, fetches the certificate for YAP_DOMAIN, sets HSTS, strips the Server header, and discards request logs so IPs and paths are never written down. |
yap-data | The volume holding everything: /data/yap.db, its WAL files and the sign-up key beside it. Backing this up is backing up the server. |
The container's entrypoint is yap-server serve --trust-proxy, with YAP_DB=sqlite:///data/yap.db and YAP_BIND=0.0.0.0:8080. --trust-proxy is correct here because Caddy is the only thing that can reach it: without it every request would look like it came from the proxy, and the per-address sign-up cap would be meaningless.
4. Check it
curl -sS https://chat.example.com/api/v1/health # expect: ok
curl -sS -o /dev/null -w '%{http_code}\n' https://chat.example.com/gateway # expect: 426
okmeans the REST half is up and the database opened (migrations run at startup, so a broken schema fails here rather than later).426 Upgrade Requiredis the correct answer from/gatewayin a plain request: it wants a WebSocket upgrade. A 404 means the gateway is not mounted; a 502 means Caddy cannot reach the container.
Then open the site in a client, create the first account, and make a space. A fresh server has two accounts per address by default, which is why the second one usually comes from an invite.
5. The flags you might change
| Flag | Default | Why you would touch it |
|---|---|---|
--max-accounts-per-ip N | 2 | 0 lifts the cap. Worth raising only if your group really does share one address. |
--voice-direct | off | Voice without a relay. Participants then see each other's IP addresses: LAN and testing only. |
--turn-url URL | none | A TURN relay for voice, repeatable; the secret comes from YAP_TURN_SECRET. With a relay configured, clients are told to use relay candidates only. |
--bind ADDR | 127.0.0.1:8080 | Where the server listens. In Docker this is set by the image, not by you. |
--db URL | sqlite://yap.db | Another SQLite path. The image points it at the volume. |
6. If it does not answer
docker compose logs caddyfor certificate trouble. The usual causes are a DNS record that does not point here yet, or port 80 blocked upstream.docker compose logs yapfor a schema or permission error. A failed migration stops the boot on purpose.- Certificate issued but
502from Caddy: theyapcontainer is not running.docker compose psshows it.
Next: TLS and reverse proxies, then backups — the one chore that is easy to postpone and impossible to undo.
Updated . Part of hosting and self-hosting.