Host the relay yourself

The relay is the small server between your computer and your phone. We run one for everyone. It is open source, so you can run the same one on a server of your own.

The short answer

Start the relay with docker compose from the aaw-core repository, put a TLS proxy in front of it, and pair your computer with aaw link --relay wss://your.host/v1/ws. The QR code carries the relay's address to the phone, so the phone needs no setting.

Should you?

You do not need your own relay for privacy. Prompts, answers and file paths are encrypted on your computer and your phone with a key that travels only in the QR code, so our relay sees ciphertext and where to deliver it. Run your own when you want no third party in the path at all, or when a policy at work asks for it.

  • What you gain: a server you control, and no plan limit. Computers on your own relay never count toward a plan.
  • What you give up: background push notifications. They need the store apps' push credentials, so on your own relay the phone gets updates while the app is open.

What you need

  • A server that your computer and your phone can both reach, with a host name.
  • Docker with compose on it.
  • A TLS proxy that passes WebSocket connections, such as Caddy or nginx, with a certificate for the host name.

Start the relay

git clone https://github.com/sergenes/aaw-core.git
cd aaw-core
docker compose -f relay/docker-compose.yml up -d

The relay now listens on 127.0.0.1:8765, on the server only. Point the TLS proxy at that port, so the relay answers at wss://your.host/v1/ws. To check it from the server:

curl http://127.0.0.1:8765/healthz

Without Docker, the same server runs from PyPI:

pip install "aaw-core[relay]"
python -m aaw_core.relay --host 127.0.0.1 --port 8765 --db relay.sqlite

Pair your computer with it

aaw link --relay wss://your.host/v1/ws

Scan the QR code it prints with the phone app. The code names the relay, so the phone connects to yours for this computer. Other computers on the same phone can stay on our relay.

The first time you run aaw link without --relay, it asks which relay to use: ours, or your own.

Keep it running

  • Back it up. The store holds encrypted events and device tokens, never a key. Losing it costs the replay of recent messages and a new pairing. A consistent copy while it runs:
    python -m aaw_core.relay.backup --db relay.sqlite --dir backups --keep 14
  • Update it before the computers. A newer relay keeps serving older engines and phones. The changelog says when a release needs a newer relay.
  • What it keeps. Events for 90 days and unanswered prompts for 30, all encrypted.

The repository's relay README has the details: the connection, the store, limits and rollback.

Related guides