# Server settings (https://www.getfounderhq.com/docs/companion/server-settings)

Companion on a server reads its settings from environment variables. All of
them are optional.

## Environment variables

| Variable | What it does | Default |
| --- | --- | --- |
| `FOUNDERHQ_COMPANION_DEVICE_NAME` | The name this server shows in FounderHQ. | The server's own name, cut to 60 characters |
| `FOUNDERHQ_COMPANION_VOICE_MODEL` | Set it to `off` to stop this server from making captions. Companion then does not download the voice model. | Captions are on |
| `FOUNDERHQ_COMPANION_DATA_DIR` | The folder for the pairing and the voice model. | `/data` in the container. The user's `~/.config/FounderHQ Companion` elsewhere |
| `FOUNDERHQ_COMPANION_HEADLESS` | Set it to `1` or `true` to run with no window, the same as `--headless`. | `1` in the container |

## Set a variable

In Docker, add `-e` to the `docker run` command:

```bash
docker run -d --name founderhq-companion --restart unless-stopped \
  -e FOUNDERHQ_COMPANION_DEVICE_NAME=render-01 \
  -v founderhq-companion:/data ghcr.io/founderhq/founderhq-companion
```

In a systemd service, add a line under `[Service]`, then restart the
service:

```ini
Environment=FOUNDERHQ_COMPANION_DEVICE_NAME=render-01
```

```bash
sudo systemctl daemon-reload
sudo systemctl restart founderhq-companion
```

## Options

| Option | What it does |
| --- | --- |
| `--headless` | Runs Companion with no tray, no window, and no browser. Pairing prints a link and a code. |
| `--unpair` | Ends this machine's pairing, then exits. |
| `--log-level=3` | Keeps the browser engine's own error lines out of the log. A server has no desktop session and no graphics card, and the engine reports that at every start. The container and the service already use this option. |

## The voice model

Companion makes captions with a voice model of about 490 MB. It downloads
the model in the background after you pair the server, and writes the
progress in the log: `Downloading voice model… 40%`. The model is kept in
the data folder, so Companion downloads it once.

If the download fails, Companion tries again after 30 minutes, up to 3
times. After that, restart Companion to try once more. The server does
not make captions until the model is there.

## The data folder

The data folder holds the pairing. A server has no keyring, so the pairing
is in a file that only Companion's user can read. Keep the folder private,
and do not copy it to another machine.

If you delete the folder, the server is no longer paired. Pair it again
from the link in the log.
