Skip to content
TEBHOS API

Run TEBHOS with Docker Compose

Use this page if your platform runs compose stacks for you, such as Portainer, TrueNAS or Unraid, and you can’t run rexctl on the machine. When you can run rexctl, install with rexctl instead, because it does all of this for you.

Every release comes with a compose bundle. Download the latest one into an empty folder and unpack it.

Terminal window
curl -fsSL https://docs.tebhos.com/compose/latest -o tebhos-compose.tar.gz
tar -xzf tebhos-compose.tar.gz
cp .env.example .env

The bundle has docker-compose.yml with every TEBHOS image pinned to the release, the Caddyfile, a few optional compose files and .env.example. The bundle for each version is also on its release on GitHub.

Set TEBHOS_DOMAIN to your instance’s domain, such as chat.example.com. Then run these commands in the folder to fill in the secrets.

Terminal window
for key in POSTGRES_PASSWORD MEILI_MASTER_KEY TEBHOS_S3_SECRET_KEY TEBHOS_SUDO_MODE_SECRET \
TEBHOS_CONNECTION_INITIATION_SECRET TEBHOS_PROFILE_PSEUDONYM_SECRET TEBHOS_GATEWAY_RPC_AUTH_TOKEN \
TEBHOS_ERLANG_COOKIE TEBHOS_MEDIA_PROXY_SECRET_KEY TEBHOS_ADMIN_SECRET_KEY_BASE \
TEBHOS_ADMIN_OAUTH_CLIENT_SECRET LIVEKIT_API_SECRET; do
sed -i "s|^$key=.*|$key=$(openssl rand -hex 32)|" .env
done
sed -i "s|^TEBHOS_SETUP_TOKEN=.*|TEBHOS_SETUP_TOKEN=$(openssl rand -hex 16)|" .env
sed -i "s|^TEBHOS_MEDIA_PROXY_UPLOAD_RELAY_SECRET_BASE64=.*|TEBHOS_MEDIA_PROXY_UPLOAD_RELAY_SECRET_BASE64=$(openssl rand -base64 32)|" .env
sed -i "s|^TEBHOS_ACTIVITYPUB_SIGNING_KEY_BASE64=.*|TEBHOS_ACTIVITYPUB_SIGNING_KEY_BASE64=$(openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -outform DER | base64 | tr -d '\n')|" .env
openssl ecparam -name prime256v1 -genkey -noout -out vapid.pem
sed -i "s|^TEBHOS_VAPID_PUBLIC_KEY=.*|TEBHOS_VAPID_PUBLIC_KEY=$(openssl ec -in vapid.pem -pubout -outform DER 2>/dev/null | tail -c 65 | base64 | tr '/+' '_-' | tr -d '=\n')|" .env
sed -i "s|^TEBHOS_VAPID_PRIVATE_KEY=.*|TEBHOS_VAPID_PRIVATE_KEY=$(openssl ec -in vapid.pem -outform DER 2>/dev/null | tail -c +8 | head -c 32 | base64 | tr '/+' '_-' | tr -d '=\n')|" .env
rm vapid.pem

Keep a copy of .env somewhere safe. The database, search, storage, voice and push keys can’t change once TEBHOS has started, because your data depends on them. If your platform asks for environment values instead of a .env file, paste the lines from .env there.

Open TCP ports 80, 443 and 7881 and UDP ports 443 and 7882, the same as for a rexctl install. Then start TEBHOS.

Terminal window
docker compose up -d

TEBHOS serves your domain over HTTPS and gets its own certificate. If another web server already uses ports 80 and 443, add these two lines to .env before you start, and point your proxy at 127.0.0.1:8080 as described in Put TEBHOS behind your own proxy.

Terminal window
COMPOSE_FILE=docker-compose.yml:docker-compose.proxy.yml
TEBHOS_EDGE_BIND=127.0.0.1:8080

When every service is healthy, open your domain in a browser and enter the TEBHOS_SETUP_TOKEN from .env to create your admin account.

Download the new bundle into the same folder and unpack it, which replaces every file except .env. If the new .env.example has a key your .env doesn’t have yet, add it, then run docker compose up -d.

Back up the Docker volumes yourself before you upgrade, because rexctl backup isn’t available without rexctl.

If you can run rexctl on the machine later, rexctl takeover --dir <folder> hands this instance to rexctl with its data and secrets as they are.